A Chronicle of My “Getting Started With Arduino” Journey

Episode 4: First Contact With Pulse Width Modulation (PWM) and analogWrite()

Shan Dou
1 min readJun 3, 2018
Fig 1: The finished look of the “color mixing lamp” project

Project 4 highlights the use of pulse width modulation (PWM) to transform a sequence of rapidly changing binary outputs into an output that appears to have intermediate values between the two extrema. The photoresistors sense the R/G/B brightness of the ambient environment and control the duty cycle length of the mixing lamp. Without any intervention, my mixing lamp shows a white and yet purple-ish glow. Cover any one of the R/G/B filters and I get to see the dimmed color in response. This marks my first time of using photoresistors for anything (I know this may sound shocking to experienced makers, but hey, everyone and everything has a start~) :)

Time to put a pause to these fun weekend activities for now. A quick wandering-around on the Internet about Arduino project of the year leaves much to be desired. As a reminder to myself: Be consistent, and always strive for the compound effects of small increments!

--

--

Shan Dou
Shan Dou

No responses yet