Created
August 5, 2018 12:29
-
-
Save nkenna/a55a9aa7e82ad6000354e7bd3d5b3331 to your computer and use it in GitHub Desktop.
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
def ldr(): | |
ldrValue = adc.read_adc(0, gain=GAIN) | |
return ldrValue | |
while True: | |
try: | |
print('LDR raw value: ' + str(ldr())) | |
sleep(2) | |
except KeyboardInterrupt: | |
GPIO.cleanup() | |
sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment