Go Down

Topic: Sleep Tutorial problem (Read 427 times) previous topic - next topic

Jan 13, 2012, 06:11 pm Last Edit: Jan 13, 2012, 06:15 pm by deltacharlie26 Reason: 1
Hi,
ref http://www.arduino.cc/playground/Learning/ArduinoSleepCode

I can't get the sleep code tutorial to work using 1.0. Works fine on V23, anybody any idea how to get the sleep mode to work, apart from using V23?

Any help appreciated.


el_supremo

Can't remember where I found this, but works for me with V1.0 on a Duemilanove.

Code: [Select]

#include <avr/sleep.h>      // powerdown library
.
.
.

//***************************************************
// *  Name:        enterSleep
  /* the sleep modes
   SLEEP_MODE_IDLE - the least power savings
   SLEEP_MODE_ADC
   SLEEP_MODE_PWR_SAVE
   SLEEP_MODE_STANDBY
   SLEEP_MODE_PWR_DOWN - the most power savings
   */
void enterSleep()
{
      set_sleep_mode(SLEEP_MODE_PWR_DOWN);
      cli();
      sleep_enable();
      sei();
      sleep_cpu();
      sleep_disable();
}


Pete

Scratch that. Finger trouble my end. Had a dodgy pos volts on Pin2 not holding the interrupt off.

Thanks.

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!

Arduino
via Egeo 16
Torino, 10131
Italy