So this sensor only says Yes there is light or no there isn't light? I would need to find one that can give me a digital range I think.bensimmo wrote: ↑Fri Apr 06, 2018 6:19 pmYou cannot.
That 'For loop' is just there to loop 5 times, nothing else.
Your sensor only has two values On and Off (or True/False ). It is effectively a switch.
I have just not the sensor has an Analogue output, the Pi cannot interface with that directly and would probably need an ADC.
For now though, with the demo code its printing a 0 for light and a 1 or dark.
How could I get it to say
Code: Select all
if 0 print LED_BRIGHTNESS 255 elif 1 print LED_BRIGHTNESS 100