Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from gpio import *
- from time import *
- motionPin=0
- garagePin=1
- value=""
- def main():
- pinMode(garagePin,OUTPUT)
- pinMode(motionPin,INPUT)
- def loop():
- while True:
- value=digitalRead(motionPin)
- value2=digitalRead(garagePin)
- print(value2)
- customWrite(1, LOW)
- if value==1:
- customWrite(garagePin, '1')
- if value==0:
- customWrite(garagePin, '1')
- print(value2)
- if __name__ == "__main__":
- main()
- loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement