Post a new topicPost a reply Page 2 of 2   [ 16 posts ]
Go to page Previous  1, 2
Author Message
 Post subject: Re: Problems Waking from Hibernate
PostPosted: Thu Jun 14, 2012 5:47 pm 

Joined: Fri Jun 01, 2012 8:18 pm
Posts: 14
Hi,
Simple hibernate codes work fine, but not always with the sensors incorporated. Can you give me another example of how you would store and call multiple alarm times using the eeprom? I looked at your example and am still confused.
Thanks.


Top
 Profile  
 
 Post subject: Re: Problems Waking from Hibernate
PostPosted: Fri Jun 15, 2012 8:38 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7456
Koz,

We were referring a code like this:

Code:
uint8_t sleepMode;
setup()

loop(){

doYourStuff();

sleepmode = readFromEEPROM();

if (sleepmode==1) sleeptime=4 hours
if (sleepmode==2) sleeptime=24 hours

saveSleepMode() // save in EEPROM for next time

hibernate(sleepTime);

}


Take a look into Wasputils.EEPROM examples to know how to read / Write from EEPROM.

Previous code is only a suggestion, there are several ways (maybe you find another better) to do it.

Best Regards.


Top
 OnlineProfile  
 
 Post subject: Re: Problems Waking from Hibernate
PostPosted: Fri Jun 15, 2012 8:04 pm 

Joined: Fri Jun 01, 2012 8:18 pm
Posts: 14
Hi,
I ran the example code, but now the board does not work properly. I looked through your example code after running it a couple of times then modifying it, and it writes to values 0-512 in the EEPROM. I read in the manual that you should not write in EEPROM for anything less than 300. Now I am afraid that my board is no longer configured properly :( Please advise.

Thanks.


Top
 Profile  
 
 Post subject: Re: Problems Waking from Hibernate
PostPosted: Mon Jun 18, 2012 8:24 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7456
Koz,

what do you mean with "but now the board does not work properly"?

It is recommended to write EEPROM above address 300 due to from 0 to 300 there are some specific data, but I is not always used so you can stay calm.

Let us know regards.


Top
 OnlineProfile  
 
 Post subject: Re: Problems Waking from Hibernate
PostPosted: Fri Jun 22, 2012 4:45 pm 

Joined: Fri Jun 01, 2012 8:18 pm
Posts: 14
Usually, when I turn the board on after uploading new code, the rightmost red light will always blink at least once so I know to remove hibernate jumper. Now, it is flighty and does not always blink, usually I have to upload the code again and keep testing until it works..


Top
 Profile  
 
 Post subject: Re: Problems Waking from Hibernate
PostPosted: Mon Jun 25, 2012 9:16 am 

Joined: Mon Sep 28, 2009 1:06 pm
Posts: 7456
Koz,

Do not worry about it.

You can blink the led and introduce a delay before hibernate sentence to know when to remove hibernate jumper. Just like that:

blinkLed();
delay(2000); // 2 seconds
hibernate();


Regards


Top
 OnlineProfile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 2 of 2   [ 16 posts ]
Go to page Previous  1, 2


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Libelium theme based on 610nm Style by Daniel St. Jules of http://www.gamexe.net


© Libelium Comunicaciones Distribuidas S.L. | Terms of use