Using a pushbutton
Turn a light on and off using a pushbutton.
In this exercise, I used a switch, photoresistor, and LED. The switch is controls the overall action of the LED light. LED and phtoresistor will only respond if the switch is switched on.
The scenario is for work lamp, which brightens up and dims down according to the existing light level in the room or daylight. But it will only work when the switch is on.
I started out with one input or sensor one a time, and then add on to it another input. This helped me to understand how the circuit works on the breadboard.
Relating the photoresistor reading value (0-4095) and the PWM range (0-255) to the actual brightness seen through human eyes, was an odd process for me. It took a few try outs to see what it actually looks like by trying out different values and checking the reading from Particle Console. The photoresistor sensor also seems a bit unstable with instances where LED brightness not reacting or reacting slowly.
Overall, I think I gained better understanding in how the circuit works on the breadboard. And it was nice to imagine how the prototype relates to the real world.
You can upload files of up to 20MB using this form.