Go Down

Topic: sleep in arduino (Read 248 times) previous topic - next topic


i want my arduino to be in sleep mode initially and after an event when i wake it up, i want to start its functionality.
so where should i put my sleepNow function? if i put it in void loop(), then do i have to initialize or set up everything again after sleep? but how we do that? or do i put it in my setup function only, before i setup other things?


You can put sleep_cpu() where ever you wish (within certain limitations). The processor will stop after executing the function and continue from there after an interrupt wakes it. You can read up on the topic here: http://playground.arduino.cc/Learning/arduinoSleepCode

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131