Pages: [1]   Go Down
Author Topic: Fading LED that goes through a few cycles, and stops  (Read 262 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm attempting to make an ornament based on the TARDIS.  I have an ATTiny45 chip programmed with the analog fade demo, and it works quite well.  But instead of having it on, all of the time, I'd like to be able to press a button, and have it cycle through the fade sequence, perhaps a dozen times, before turning itself off, so the battery isn't being wasted.

Eventually, I'd love to have it play the TARDIS sound  as it does that (but, as this is my first foray, baby steps!).

Suggestions as to how I can implement this?
Logged

Denmark
Offline Offline
Edison Member
*
Karma: 35
Posts: 1057
Happy Hobbyist
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
cycle through the fade sequence, perhaps a dozen times

You could make a loop in the setup() runing a dozen time, and nothing in the loop()

Next step could be putting the chip to save current by sleeping
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That sounds brilliant; then, it would "wake" upon button push?
Logged

Denmark
Offline Offline
Edison Member
*
Karma: 35
Posts: 1057
Happy Hobbyist
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
That sounds brilliant; then, it would "wake" upon button push?

yes, that was the idea
Logged

Pages: [1]   Go Up
Jump to: