Wake Arduino up after Sleep


hi, i'm doing project wireless weather station.
i've written program arduino can send temperature data , goes sleep 5 seconds. after uploading program arduino send data once , can't wake again.

my code below:

#include <avr/sleep.h>

float tempanalogdata;
float tempdigitaldata;
int temppin = 0;

void setup()
{
serial.begin(9600);
}

void sleepnow()
{

 set_sleep_mode(sleep_mode_pwr_save);

 sleep_enable();  

 sleep_mode();    
}

void loop()
{
tempanalogdata = analogread(temppin);
          //read value sensor
tempdigitaldata = (5.0 * tempanalogdata * 100.0)/1024.0;  //convert analog data temperature
serial.print(tempdigitaldata);             //send data computer
serial.println(" c");
 
sleepnow();
delay (5000);
}


could please me on how modify code waking function?

any appreciated. thanks! :)

you either need source of external interrupts or enable watchdog.
search forum - there thread not long ago.

here:http://www.arduino.cc/cgi-bin/yabb2/yabb.pl?num=1263247150


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Wake Arduino up after Sleep


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums