The Programmator

How to program a Digispark ATTiny85 using the Arduino IDE

Unlike the Arduino boards, the Digispark ATTiny85 development board isn’t as plug-and-play as you’d hope. Read on to get you started in no time!

Digispark Development Board

Digispark Development Board

Download and install software

First, we need to get our environment set up for development. Go through this setup guide to get you started!

Gotcha’s after installing

  • I had to run the driver update bat file manually. You can find it here: C:\Users\[user]\AppData\Local\arduino15\packages\digistump\tools\micronucleus\2.0a4\post_install.bat
  • It isn’t explained in the setup guide, but don’t forget to set the Programmer in your Arduino IDE to Micronucleus before building and deploying your sketch.
  • As a reminder, don’t plug in your ATTiny until after the sketch is built. It will wait 60 seconds for you to plug in the USB cable, and then install the sketch automatically when the board is detected.

Example

The basic Blink sketch provided in the setup guide should work by now. But let’s try something more real life, like switching an LED with the use of a button.

Wiring

Normally, the pins’ purpose should be printed on the board. Either on the front, or the back side. Additionally, all the specs are in the data sheet.

ATTiny pin explanation

I have to admit my soldering on this board was terrible.

  • Connect the ground pin to the button and the LED.
  • Connect pin 0 to the LED. I have placed a small resistor between pin 0 and the LED’s anode.
  • Connect pin 2 to the button’s signal pin.
  • Connect the 5v pin to the button’s power-pin.

The code

As you can see, this is a very basic sample, there isn’t really much to explain about the code.

Result

Button Digispark Development board LED

Can you see how the ATTiny is so small it’s almost the same size as a simple button control?!

Please leave your feedback below!

Like what you read? Maybe your friends do too! Share this article:

Leave a Reply

Tags: ,