Skip to content

Instantly share code, notes, and snippets.

@uktechreviews
Created October 28, 2018 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uktechreviews/ebce91cd47ee39885c088bd004ff3696 to your computer and use it in GitHub Desktop.
Save uktechreviews/ebce91cd47ee39885c088bd004ff3696 to your computer and use it in GitHub Desktop.
light box
#!/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