The ATTiny85 is a cheap, programmable microcontroller. It can do many of the things an Arduino can do. But, how do you get your Arduino sketches onto an ATTiny85? You can setup your Arduino to program an ATTiny85, that's how!



The smart people at High-Low Tech have written a terrific tutorial that explains exactly how to do this. You can read the tutorial here: http://hlt.media.mit.edu/?p=1695



In a nutshell, here's what you're going to do:



1. Connect your Arduino and upload the ArduinoISP example sketch to it. This sketch comes pre-installed with the Arduino IDE. It's in the Examples folder.



2. Setup a breadboard with the ATTiny85 and connect it to the Arduino. You'll find the full details on this setup in the High-Low Tech tutorial.



3. Select ATTiny85 @ 1MHz (Internal Oscillator) from the Tools > Board menu.



4. Upload the Traffic Light sketch (seen later in this tutorial) to your ATTiny85.



Here are some additional things you should know:



1. I have version 1.0.4 of the Arduino IDE, and the instructions in the High-Low Tech tutorial worked perfectly for me.



2. When programing an ATTiny85, you must select a board definition in the Tools > Board menu of the Arduino IDE. This tells the Arduino IDE which ATTiny "core" to use. The High-Low Tech tutorial tells you to download and use an ATTiny core from GitHub. There's nothing wrong with this core, and many people use it! However, it only lets you use hardware pulse width modulation (PWM) on two pins of the ATTiny. I wanted to use PWM on three pins. Thankfully, you can use any ATTiny core you like. I used the arduino-tiny core from Google Code. This core lets you use PWM on pins 0, 1, and 4.



So, you should download the arduino-tiny core from: https://code.google.com/p/arduino-tiny/



3. If you bought the exact same ATTiny85 I bought from Jameco, you'll notice that it is a 20MHz microcontroller. So, you'll probably do what I did and look for a 20MHz board definition in the Tools > Board menu. If you're using the arduino-tiny core, you won't find one! But, that's okay! It wouldn't have worked properly anyway! See, these ATTiny85 chips run at 1MHz from the factory unless you upload a specific bootloader and use an external crystal. You don't need to do any of that for this tutorial.



So, you should select ATTiny85 @ 1MHz (Internal Oscillator) from the Tools > Board menu.