Skip to content
Example Arduino Sketches for programming the ATTiny85
Branch: master
Clone or download
Pull request Compare This branch is 3 commits behind aatishb:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Get started programming the ATTiny

A few example sketches to program the ATTiny85 using the Arduino software. The ATTiny is a tiny programmable microcontroller that costs < $1. It works great as a low-cost, smaller and less powerful alternative to an Arduino.


  • LilyTwinkle or ATTiny85
  • Tiny AVR Programmer and USB extension cable
  • TM1637 4-digit LED display (we use these for reading voltages as the ATTiny doesn't support serial communication)

If using LilyTwinkle or SOIC footprint ATTiny:

  • IC Test Clip - SOIC 8-pin
  • Male to Female Jumper wires


  1. Use this guide to install ATtiny drivers for the Arduino IDE. Under the tools menu in the Arduino IDE, set the Board to "ATtiny 25/45/85", the Processor to "ATtiny85", the Clock to "Internal 8 Mhz", and the Programmer to "USBtinyISP".

  2. Follow these instuctions to connect the ATtiny using the tiny AVR programmer. If you aren't using the LilyTwinkle and have a standalone ATTiny (DIP footprint), plug it into the socket on the Tiny AVR programmer.

  3. Open up these examples in your Arduino IDE. You'll need to assemble the corresponding circuit for each sketch.

  4. To use the TM1637 LED display, you'll need to install a library. In the Arduino IDE, go to Sketch > Include Libraries > Manage Libraries and search for 1637. You should find the 'Grove 4-Digit Display' library by Seeed Studio. Click install.


Built by Aatish Bhatia and Sharon De La Cruz at Princeton University's Council on Science and Technology.

The TinyTone function for producing musical tones on the ATtiny85 was created by David Johson-Davies.

You can’t perform that action at this time.