Advertisement
edofhell

Python if on then off reverse

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