SHARE
TWEET

Untitled

a guest Dec 12th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from gpio import *
  2. from time import *
  3. motionPin=0
  4. garagePin=1
  5. value=""
  6. def main():
  7.     pinMode(garagePin,OUTPUT)
  8.     pinMode(motionPin,INPUT)
  9. def loop():
  10.     while True:
  11.         value=digitalRead(motionPin)
  12.         value2=digitalRead(garagePin)
  13.         print(value2)
  14.         customWrite(1, LOW)
  15.         if value==1:
  16.             customWrite(garagePin, '1')
  17.         if value==0:
  18.             customWrite(garagePin, '1')
  19.             print(value2)
  20.  
  21.  
  22. if __name__ == "__main__":
  23.     main()
  24.     loop()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top