This post originated from an RSS feed registered with Python Buzz
by Aaron Brady.
Original Post: attiny461-atx
Feed Title: insom.me.uk
Feed URL: http://feeds2.feedburner.com/insommeuk
Feed Description: Posts related to using Python. Some tricks and tips, observations, hacks, and the Brand New Things.
As with many of my projects, this one deserves more of a write-up than I have
time to give it right now. I wanted to get it up on GitHub so that
anyone else looking for an example of using the timer interrupts / ISRs on the
ATtiny461 can find it.
The algorithm is basically:
If the power is off, turn it on when the button is pressed.
If the power is on, don’t turn off on a single press.
If the power is on and the button is held for 6 seconds, turn the power off.
If the button is held after the power has been turned off, don’t turn on
until it’s released first.
The Makefile is from Markus Conrad’s project, and was invaluable for
getting things up and running. I used a BusPirate for programming, though I’ve
gotten a real AVR programmer in the mean time, so I’d like to revisit and
finish this.