Getting ready

You will need the following equipment:

  • 4 x DuPont female-to-male patch wires
  • Mini breadboard (170 tie points) or a larger one
  • RGB LED (common cathode)/3 standard LEDs (ideally red, green, and blue)
  • Breadboard wire (solid core)
  • 3 x 470 ohm resistors

Each of the preceding components shouldn't cost many dollars and can be reused for other projects afterwards. The breadboard is a particularly useful item that allows you to try out your own circuits without needing to solder them:

Diagrams of an RGB LED, a standard LED, and an RGB circuit

The following diagram shows the breadboard circuitry:

The wiring of an RGB LED/standard LEDs connected to the GPIO header
There are several different kinds of RGB LEDs available, so check the datasheet of your component to confirm the pin order and type you have. Some are RGB, so ensure that you wire accordingly or adjust the RGB_ pin settings in the code. You can also get common anode variants, which will require the anode to be connected to 3V3 (GPIO-pin 1) for it to light up (and they will also require RGB_ENABLE and RGB_DISABLE to be set to 0 and 1 respectively).

The breadboard and component diagrams of this book have been created using a free tool called Fritzing (www.fritzing.org); it is great for planning your own Raspberry Pi projects.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.164.24