Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import RPi.GPIO as GPIO
  2. import time
  3.  
  4. GPIO.setmode(GPIO.BCM)
  5. GPIO.setwarnings(False)
  6.  
  7. PIN1 = 14
  8. PIN2 = 15
  9.  
  10. GPIO.setup(PIN1,GPIO.OUT)
  11. GPIO.setup(PIN2,GPIO.OUT)
  12.  
  13. while True:
  14. print("MOTOR RIGHT")
  15. GPIO.output(PIN1,True)
  16. GPIO.output(PIN2,False)
  17. time.sleep(1)
  18. print("MOTOR LEFT")
  19. GPIO.output(PIN1,GPIO.LOW)
  20. GPIO.output(PIN2,GPIO.HIGH)
  21. time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement