Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import RPi.GPIO as IO
- IO.setwarning(False)
- IO.setmode(IO.BOARD)
- IO.setup(8,IO.IN)
- IO.setup(3,IO.OUT)
- while 1:
- if(IO.input(8)==True):
- print("Obstacle detected!!!")
- IO.output(3,True)
- else:
- print("Obstacle not detectedc")
- IO.output(3,False)
Advertisement
Add Comment
Please, Sign In to add comment