Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import RPi.GPIO as GPIO
- import time
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(17, GPIO.OUT)
- try:
- print('1: ')
- time.sleep(2)
- GPIO.output(17, False)
- print(GPIO.input(17))
- print('2: ')
- time.sleep(2)
- GPIO.output(17, True)
- print(GPIO.input(17))
- print('3: ')
- time.sleep(2)
- GPIO.output(17, False)
- print(GPIO.input(17))
- print('4: ')
- finally:
- GPIO.cleanup()
- 1:
- 0
- 2:
- 1
- 3:
- 0
- 4:
Add Comment
Please, Sign In to add comment