For this assignment I decided to use a photoresistor and followed this tutorial So the first thing as always was to connect according to the circuit diagram and the components I used were: red LED, 220Ohm resistor, PhotoCell, 10kOhm resistor, the microcontroller, breadboard, and wiring.
For the code, the analog value for the photoresitor was value=analogRead(pResistor) and I set the value between 0 and 1023. After that I ran the code and see the LED behavior.
If you would like to see more how I used the photoresistor in a different way, please go to outputs week where I used it to activate a servo motor.
Elsa Garduño
04.01.2020
Fab Academy