You'll need the Raspberry Pi that you set up in Chapter 1, Setting Up Your Development Environment, a breadboard, and a Pi Cobbler for easier pin access. You can get a Pi Cobbler (also sometimes called a Pi Wedge) from Adafruit, SparkFun, or Amazon. A Pi Cobbler also comes in the kits recommended in Chapter 1, Setting Up Your Development Environment.
The example code for this chapter is here: https://github.com/PacktPublishing/Hands-On-Robotics-with-JavaScript/tree/master/Chapter02.
The following diagram shows two different Raspberry Pi Cobblers, both from Adafruit. The one on the right has the ribbon cable attached:
We'll talk about how to set up the cobbler later in this chapter. You'll also need an LED, some jumper or breadboard wires, and a 330-ohm resistor.
In case you're asking yourself what's a resistor, and what does it do?, the short explanation is that a resistor will prevent the 5V electricity from the pin from burning out your LED, which needs closer to 3.3V of electricity. For a better primer on electricity, voltage, and resistors, there is some great, free material on SparkFun's website. You can access this material via the following links:
Electricity: https://learn.sparkfun.com/tutorials/what-is-electricity
Resistors: https://learn.sparkfun.com/tutorials/resistors
Electricity: https://learn.sparkfun.com/tutorials/what-is-electricity
Resistors: https://learn.sparkfun.com/tutorials/resistors