O'Reilly logo

Mastering Arduino by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Circuit diagrams

The following diagram shows how we would connect a common anode RGB LED to the Arduino:

In this diagram, we show how to connect a common anode RGB LED. We can see this because the common pin is connected to the power rail on the breadboard. If the RBG LED that you are using is a common cathode LED, then connect the common pin, on the LEDs, to the ground rail instead of the power rail. Each of the RGB pins is connected to the Arduino PWM pins with a 330 ohm resistor.

We are not showing a circuit diagram for the NeoPixel shield because we only need to attach the shield to the Arduino. Now let's look at the code.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required