Advertisement
edofhell

onoffbutton python

Feb 14th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. onoff.py
  2. #!/usr/bin/env python
  3. import RPi.GPIO as GPIO
  4. import os
  5.  
  6. GPIO.setmode(GPIO.BCM)
  7. ledState = False
  8. GPIO.setup(7,GPIO.OUT)
  9.  
  10. ledState = not ledState
  11. GPIO.output(7, not GPIO.input(7))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement