Society of Robots - Robot Forum
Electronics => Electronics => Topic started 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
-
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?
-
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)
-
thnx it was a vry useful resource