Skip to content

PlatformIO example project to build the canonical blink code for the Digispark USB development board with an Atmel AVR ATtiny85 microcontroller

License

Notifications You must be signed in to change notification settings

koenvervloesem/digispark_blink_platformio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Digispark Blink example for PlatformIO

Continuous integration License

This is an example project for PlatformIO to build the canonical blink code for the Digispark USB development board with an Atmel AVR ATtiny85 microcontroller.

Note

This doesn't use the Arduino framework, but directly uses the native AVR registers.

You can use this project as a template to build your own AVR code for the Digispark with PlatformIO.

Requirements

You need PlatformIO and the Atmel AVR platform in PlatformIO. You can install both with:

pip3 install platformio
pio platform install atmelavr

The Digispark runs the Micronucleus bootloader. If you've bought it recently, the bootloader is a recent version that isn't supported by PlatformIO's older micronucleus command. Therefore, you need to build the newer version of the command. On Ubuntu or Debian this goes like this:

git clone https://github.com/micronucleus/micronucleus.git
cd micronucleus/commandline
sudo apt install libusb-dev
make
sudo make install

The platformio.ini file in this example project defines a custom command to refer to the micronucleus command you've built.

Usage

Build the code with:

pio run

Build and upload the code to the Digispark with:

pio run -t upload

Plug in the device into a USB port of your computer when asked.

If you want to use this project as a template for your own projects, have a look at the GitHub Action file. It automatically builds the code on each push and pull request and checks for errors and warnings. There's also a Makefile to make checking and building code easier.

License

This project is provided by Koen Vervloesem as open source software with the MIT license. See the LICENSE file for more information.

About

PlatformIO example project to build the canonical blink code for the Digispark USB development board with an Atmel AVR ATtiny85 microcontroller

Topics

Resources

License

Stars

Watchers

Forks