Adafruit PyBadge

The Adafruit PyBadge is a ARM development board based on the Atmel ATSAMD51J19A family of SoC.

It has many built-in devices, such as a 1.8” 160x128 Color TFT Display, 8 x buttons, 5 x NeoPixels, a triple-axis accelerometer, a light sensor, and a speaker. The PyBadge uses the ST7735 display, so you may use the tinygo-org st7735 driver. The accelerometer is the LIS3DH so you may use the tinygo lis3dh driver

Interfaces

InterfaceHardware SupportedTinyGo Support
GPIOYESYES
UARTYESYES
SPIYESYES
I2CYESYES
ADCYESYES
PWMYESYES

Machine Package Docs

Documentation for the machine package for the Adafruit PyBadge

Flashing

UF2

The PyBadge comes with the UF2 bootloader already installed.

CLI Flashing on Linux

  • Plug your PyBadge into your computer’s USB port.
  • Flash your TinyGo program to the board using this command:
  1. tinygo flash -target=pybadge [PATH TO YOUR PROGRAM]
  • The PyBadge board should restart and then begin running your program.

CLI Flashing on macOS

  • Plug your PyBadge into your computer’s USB port.
  • Flash your TinyGo program to the board using this command:
  1. tinygo flash -target=pybadge [PATH TO YOUR PROGRAM]
  • The PyBadge board should restart and then begin running your program.

CLI Flashing on Windows

  • Plug your PyBadge into your computer’s USB port.
  • Double tap the “RESET” button on the board.
  • Wait until the PyBadge board appears as a flash drive.
  • Flash your TinyGo program to the board using this command:
  1. tinygo flash -target=pybadge [PATH TO YOUR PROGRAM]
  • The PyBadge board should restart and then begin running your program.

Troubleshooting

If you have troubles getting your PyBadge board to receive code, try this:

  • Press the “RESET” button on the board two times to get the PyBadge board ready to receive code.
  • The PyBadge board will appear to your computer like a USB drive.
  • Now try running the command as above:
  1. tinygo flash -target=pybadge [PATH TO YOUR PROGRAM]

Once you have updated your PyBadge board the first time, after that you should be able to flash it entirely from the command line.

Notes

You can use the USB port to the PyBadge as a serial port. UART0 refers to this connection.