Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from LDRIII import MCP3008
- import time
- adc = MCP3008()
- try:
- while True:
- #Channel = 0
- Vref = 3.3
- Voltage = (Vref / adc.read(channel = 0))
- print("The Reading:\t", (adc.read(channel = 0)))
- print("Voltage:\t", Voltage)
- time.sleep(4)
- except:
- print("Turning off the source!")
- pass
Add Comment
Please, Sign In to add comment