duff2013 / Snooze

Teensy Low Power Library
MIT License
134 stars 37 forks source link

basic question #38

Closed TimoteoMendes closed 5 years ago

TimoteoMendes commented 7 years ago

Hello Duff,

First I would like to know the difference between sleep modes. Need to perform a simple task but do not know what is the best option. The idea is something like this...

include

include

SnoozeAlarm alarm; SnoozeBlock config_teensy36(alarm);

unsigned long hours, hours1; unsigned int record = 10; // in seconds

void setup() { pinMode(LED_BUILTIN, OUTPUT);

hours1 = now() + 60; //first record from 1 minuto now

}

void loop() { hours = now();

int who; who = Snooze.deepSleep( config_teensy36 );

if (hours1 >= hours){ //Start_record alarm.setRtcTimer(0, parar, 0); //sleep for sametime } //wake up here?! go to loop }

but this reset all the system and does not start again from the last line...

Do you have any suggestion here. Thanks

duff2013 commented 7 years ago

I'll take a look at your issue, just in the future please put code tags around any code to make easier to read.