The first step with any new hardware is the 'hello world' of electronics - blinking an LED. This is very easy with CircuitPython and DragonBoard410c. We'll extend the example to also show how to wire up a button/switch.

The DragonBoard 410c pin layout is different than Raspberry Pi and uses 1.8 Volt Logic Levels. Connecting anything higher could destroy your board.
Pin 28 is labeled as reserved because it is not attached to the primary GPIO controller. However, we mapped it to the proper location, so it is completely usable.

Parts Used

Any old LED will work just fine as long as it's not an IR LED (you can't see those) and a 470 to 2.2K resistor

Single large LED lit up blue
Need some big indicators? We are big fans of these huge diffused blue LEDs. They are really bright so they can be seen in daytime, and from any angle. They go easily into a breadboard...
In Stock
Angled shot of 25 Through-Hole Resistors - 470 ohm 5% 1/4W.
ΩMG! You're not going to be able to resist these handy resistor packs! Well, axially, they do all of the resisting for you!This is a 25 Pack of...
In Stock

Some tactile buttons or switches:

Angled shot of 10 12mm square tactile switch buttons.
Medium-sized clicky momentary switches are standard input "buttons" on electronic projects. These work best in a PCB but
In Stock

Because the DragonBoard 410c uses 1.8V logic levels, you will need a logic level converter to interface with most peripherals.

Angled shot of a 4-channel I2C-safe Bi-directional Logic Level Converter.
Because the Arduino (and Basic Stamp) are 5V devices, and most modern sensors, displays, flashcards, and modes are 3.3V-only, many makers find that they need to perform level...
In Stock

We recommend using a breadboard and some male-male wires.

Angled shot of Premium Male/Male Jumper Wires - 40 x 6 (150mm)
Handy for making wire harnesses or jumpering between headers on PCB's. These premium jumper wires are 6" (150mm) long and come in a 'strip' of 40 (4 pieces of each of...
In Stock
Angled shot of half-size solderless breadboard with red and black power lines.
This is a cute, half-size breadboard with 400 tie points, good for small projects. It's 3.25" x 2.2" / 8.3cm x 5.5cm with a standard double-strip in the...
In Stock


  • Connect the DragonBoard Ground pin to the blue ground rail on the breadboard
  • Connect the DragonBoard +5V pin to the red 5V rail on the breadboard.
  • Connect the DragonBoard +1.8V pin to the LV pin on the Logic Level Converter
  • Connect the HV pin on the Logic Level Converter to the 5V rail
  • Connect the Ground pin on the Logic Level Converter to the blue ground rail on the breadboard 
  • Connect one side of the tactile switch to the B1 pin on the Logic Level Converter
  • Connect a ~10K pull up resistor from B1 to the 5V rail
  • Connect the other side of the tactile switch to the ground rail
  • Connect the longer/positive pin of the LED to the B2 pin on the Logic Level Converter
  • Connect the shorter/negative pin of the LED to a 470ohm to 2.2K resistor, the other side of the resistor goes to ground rail
  • Connect the DragonBoard GPIO_B pin (GPIO 12) to the A1 pin on the Logic Level Converter
  • Connect the DragonBoard GPIO_A pin (GPIO 36) to the A2 pin on the Logic Level Converter

Double-check you have the right wires connected to the right location, it can be tough to keep track of GPIO pins as there are forty of them!

No additional libraries are needed so we can go straight on to the example code

However, we recommend running a pip3 update!

sudo pip3 install --upgrade adafruit_blinka

Blinky Time!

The finish line is right up ahead, let's start with an example that blinks the LED on and off once a second (half a second on, half a second off):

import time
import board
import digitalio

print("hello blinky!")

led = digitalio.DigitalInOut(board.GPIO_A)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    led.value = False

Verify the LED is blinking. If not, check that it's wired to the correct Logic Level Converter channel, that the Logic Level channel is connected to GPIO_A or GPIO_36, the resistor is installed correctly, and you have a Ground wire to the DragonBoard. Also, be sure to check the Power and Ground wires to the Logic Level Converter.

Type Control-C to quit

Button It Up

Now that you have the LED working, let's add code so the LED turns on whenever the button is pressed:

import time
import board
import digitalio

print("press the button!")

led = digitalio.DigitalInOut(board.GPIO_A)
led.direction = digitalio.Direction.OUTPUT

button = digitalio.DigitalInOut(board.GPIO_B)
button.direction = digitalio.Direction.INPUT
# use an external pullup since we don't have internal PU's
#button.pull = digitalio.Pull.UP

while True:
    led.value = not button.value # light when button is pressed!

Press the button - see that the LED lights up!

Type Control-C to quit

This guide was first published on Jun 28, 2019. It was last updated on Feb 04, 2024.

This page (Digital I/O) was last updated on Jun 25, 2019.

Text editor powered by tinymce.