/
SnoozeLib.h
35 lines (31 loc) · 1.48 KB
/
SnoozeLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*********************************************************************************
* SnoozeLib: This Arduino Library make the use of Low Power Mode *
* very Easy. This library Helps you make your arduino based microcontroller *
* use the Low Power Mode it use the WatchDog Functionallity and sleep the *
* CPU clock for low consumption. *
* this library is under GNU GPL v3 license. *
* Version: 1.0. *
* Based on the library Narcoleptic: https://code.google.com/p/narcoleptic/ *
* Author: Victor Suarez Garcia<suarez.garcia.victor@gmail.com> *
*********************************************************************************/
#ifndef SnoozeLib_h
#define SnoozeLi_h
#include <inttypes.h>
#include <stdbool.h>
#include <Arduino.h>
/***********************************************
* SnoozeClass. provides Low Power Mode Control*
* Version: 1.0. *
***********************************************/
class SnoozeLib
{
public:
SnoozeLib();
void snooze(long miliseconds);//Snooze the Microcontroler for the indicates Miliseconds
void wakeup();//Wake Up The MicroController
private:
int sleeping;//Variable that indicates if is SLEEPING or NOT.
void sleep(uint8_t);//Sleep the microcontroler using the Watchdog
};
extern SnoozeLib snoozeLib;
#endif