Connect the hardware

Before writing any code, you need to connect peripherals from your development kit to your board.

In this lesson, you will learn to wire a pushbutton switch and LED from a breadboard to your device. To connect the peripherals to your board:

  1. Connect one side of the button to the chosen GPIO input pin, and the other side to ground.
  2. Connect the same GPIO input pin to +3.3V through a pull-up resistor.
  3. Connect the chosen GPIO output pin to one side of a series resistor.
  4. Connect the other side of the resistor to the anode side (longer lead) of the LED.
  5. Connect the cathode side (shorter lead) of the LED to ground.

For this lesson, the following GPIO pins are assumed on each board:

Board Input Signal Output Signal
Raspberry Pi BCM21 BCM6