I am trying to power my Attiny85 using a 9V battery. I have an LM317T regulator. Output wise I am wanting 5V. Can someone help me with this? I know the pins on the LM317 are Vout, Adj, and Vin. I am just confused as to how to wire it all up to end up with 5V for the Attiny85 and some LEDs.

Just calculate the values of the two voltage divider resistors as per the LM317 data sheet. Add any decoupling capacitors required. (Long time since I used an LM317.)

Hope this helps:

There are also calculators you can find if you google it.

I like to use R1=240? and R2=390? for 3.3V.

I got it guys thanks. For those that care I used a 220 ohm and a 68 ohm for 5.29 volts. XD

That is a good amount of power being wasted in you divider. It add almost another 20mA to your power drain. Couldin't you choose larger values for the resistors? What would happen if you used 680 and 2.2k? That should cut the wasted power by 90%

Good point. Thanks. :)

If you are building a blinky (processor, LEDs, supporting components) running your project directly from a few AA batteries is a great choice. In my testing, despite violating the electrical specifications, the ATtiny85?V? has been reliable down to 1.6 volts (at which point the batteries fail). The ATtiny85 (no-V) should have no problem running directly from 3 AA alkaline batteries; even at 8 MHz.