import time import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(16, GPIO.OUT) GPIO.setup(26, GPIO.OUT) GPIO.setup(5, GPIO.OUT) GPIO.setup(6, GPIO.OUT) print ("Car is moving Forward.") GPIO.output(16, 1) GPIO.output(26, 1) time.sleep(4) print("Car is moving backward.") GPIO.output(5,1) GPIO.output(6, 1) time.sleep(3) GPIO.cleanup()
Now, the shell is print 'Car is moving forward' and also, my robot tires are moving forward. then, 'Car is moving backward' print is being print but Robot tires are not moving backward. What am I doing wrong in the code?