From the course: Learning Arduino: Pulse Width Modulation

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Challenge: Fading through the rainbow with PWM

Challenge: Fading through the rainbow with PWM - Arduino Tutorial

From the course: Learning Arduino: Pulse Width Modulation

Start my 1-month free trial

Challenge: Fading through the rainbow with PWM

Are you ready for another challenge? In this challenge, I want you to build on the activity in the last lesson, and automate the arduino to fade through the rainbow with pulse width modulation. Start by turning on the red anode, then slowly fade from red to green, green to blue, and then back around to red. This should be accomplished through programming, with no manual input necessary. If you get stuck, go back and watch the video on fading an LED with pulse width modulation. If you're looking for an additional challenge, try writing your own function to accomplish this task. This should take you around 20 minutes, but don't worry if it takes you longer. Be sure to come back and check my solution and see how I solved this problem.

Contents