From the course: Learning Arduino: Pulse Width Modulation

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Challenge: Programming an LED that reacts to brightness

Challenge: Programming an LED that reacts to brightness - Arduino Tutorial

From the course: Learning Arduino: Pulse Width Modulation

Challenge: Programming an LED that reacts to brightness

- Okay folks, it's time for another challenge. In this challenge, I want you to make an LED adjust in brightness with a photoelectric sensor. Use the calibration, or analogInput example in the Arduino IDE as a starting point. Or, if you're really feeling like a challenge, write it from scratch. If you're having trouble connecting the photosensor, refer to the 03_03 Challenge handout for a wiring schematic. Remember, you will need to include a resistor in series to pull down the voltage. A 10K resistor should work well. Once you have everything hooked up, cover the sensor and see what happens. You can also try shining a light on the sensor. Record your results. This should take you no more than 10 minutes. Be sure to watch my solution video to see how I solved this problem.

Contents