Before we wire up and run our RGB LED project, a discussion about PWM pins and GPIO expanders is warranted, because these are topics that will affect most Johnny-Five projects that you will complete.
PWM pins and GPIO expanders
How do PWM pins work?
You don't always want an LED to at its full brightness, especially in the case of RGB LEDs, where the brightness of each channel (red, green, and blue) determines the perceived color of the LED. The pins on most microcontrollers are digital: they are either HIGH at 5V or LOW at 0V. So how do you adjust the brightness of an LED with these types of pins? The answer involves the idea of average voltage and the speed at which we can flip a digital pin from HIGH to LOW.Â
Pulse...