Move master branch from from mios git repo

This commit is contained in:
hek
2014-01-23 00:23:15 +01:00
commit 609d9e5be9
352 changed files with 53418 additions and 0 deletions
@@ -0,0 +1,44 @@
#include <Sleep_n0m1.h>
Sleep sleep;
boolean abortSleep; //cancel sleep cycle
int sleepCycleCount; //the number of times awake then asleep
unsigned long sleepTime; //how long you want the arduino to sleep
void setup()
{
Serial.begin(9600);
abortSleep = false; //can be used to cancel the sleep cycle
sleepTime = 5000; //set sleep time in ms, max sleep time is 49.7 days
}
void loop()
{
if(abortSleep)
{
Serial.println("sleep no more!");
}
else
{
delay(100);
Serial.print("sleeping for ");
Serial.println(sleepTime);
delay(100); //delay to allow serial to fully print before sleep
}
sleepCycleCount++;
if(sleepCycleCount > 5)
{
abortSleep = true;
}
sleep.pwrDownMode(); //set sleep mode
sleep.sleepDelay(sleepTime,abortSleep); //sleep for: sleepTime
}