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 - 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.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Fading an LED with PWM with code3m 5s
-
(Locked)
Calibrating an analog input to fade an LED precisely3m 35s
-
(Locked)
Challenge: Programming an LED that reacts to brightness54s
-
(Locked)
Solution: Programming an LED that reacts to brightness2m 45s
-
(Locked)
Using an RGB LED3m 49s
-
(Locked)
Mixing colors on an RGB LED using three analog inputs1m 43s
-
(Locked)
Challenge: Fading through the rainbow with PWM51s
-
(Locked)
Solution: Fading through the rainbow with PWM2m 21s
-
-
-