Created
October 28, 2018 13:53
-
-
Save uktechreviews/ebce91cd47ee39885c088bd004ff3696 to your computer and use it in GitHub Desktop.
light box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
import automationhat | |
time.sleep(0.1) # short pause after ads1015 class creation recommended | |
print(""" | |
Press CTRL+C to exit. | |
""") | |
while True: | |
value = automationhat.analog.one.read() | |
print(value) | |
if value==3.31: | |
automationhat.output.on() | |
print("lihts on") | |
time.sleep(60) | |
else: | |
automationhat.output.off() | |
time.sleep(0.5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment