Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: gaurav.p on July 16, 2010, 04:42:59 AM

Title: sleep mode on arduino
Post by: gaurav.p on July 16, 2010, 04:42:59 AM
i hav a arduino board based on atmega8 and i want a functionality so that it would go into a sleep mode after pressing of a button on the board.in the atmega8 datasheet it is specified that the atmega8 has sleep mode function.how can it be done?

regards,
shakerobo
Title: Re: sleep mode on arduino
Post by: voyager2 on July 16, 2010, 04:58:14 AM
Maybe an interrupt?
When the button is pressed, it activates an interrupt, turning of all non-essential functions and processes(servos,sensors,etc.)
I've heard this is not recommended though, as most robots can't afford to urn off anything at any time.
But too go into the atmega8 sleep mode, hmm, seems hard, anything in the data-sheet about doing this that you may have missed?
Title: Re: sleep mode on arduino
Post by: Razor Concepts on July 16, 2010, 05:25:58 AM
You can go into sleep mode just through the code itself, no interrupts needed, usually you use the interrupt to wake up from sleep mode.

Here's something to look into:
http://www.arduino.cc/playground/Learning/ArduinoSleepCode (http://www.arduino.cc/playground/Learning/ArduinoSleepCode)
Title: Re: sleep mode on arduino
Post by: gaurav.p on July 17, 2010, 06:18:33 AM
thnx it was a vry useful resource