Intention
Integrate sensing into the circuits and read information from the environment around. When the switch is turned on, the LED output changes based on the input.
Components: Breadboard, Light Sensor, Switch, LED, Jumper Wires, 2 Resistors
1. Building a circuit with 1 input and 1 output: light sensor and LED
2. Writing code for the LED brightness to change based on the lighting
3. Debugging: the light in the surroundings was too bright, so I had to modify the code adjusting the conversion scale based on the brightness.
4. Modifying circuit to include a second input: switch
5. Modifying code so the computer first checks if the switch is on and then gets data from the light sensor to modify the light brightness on the LED.
Initially, I chose to work with a knock sensor. The sensor needed a different code; being unfamiliar with coding & circuits, I decided to start with the light sensor and experiment with the knock sensor. I also realized that clearly writing down what I wanted the code to do before coding makes things easier.
You can upload files of up to 20MB using this form.