Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/koenvervloesem/digispark_blink_platformio

PlatformIO example project to build the canonical blink code for the Digispark USB development board with an Atmel AVR ATtiny85 microcontroller
https://github.com/koenvervloesem/digispark_blink_platformio

atmel atmel-avr atmel-avr-microcontroller attiny85 avr avr-programming blink digispark digispark-usb platformio

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

######################################
Digispark Blink example for PlatformIO
######################################

.. image:: https://github.com/koenvervloesem/digispark_blink_platformio/workflows/Build/badge.svg
:target: https://github.com/koenvervloesem/digispark_blink_platformio/actions
:alt: Continuous integration

.. image:: https://img.shields.io/github/license/koenvervloesem/digispark_blink_platformio.svg
:target: https://github.com/koenvervloesem/digispark_blink_platformio/blob/main/LICENSE
:alt: 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:

.. code-block:: shell

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:

.. code-block:: shell

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:

.. code-block:: shell

pio run

Build and upload the code to the Digispark with:

.. code-block:: shell

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.