ArduinoLibs
Main Page
Related Pages
Modules
Classes
Files
File List
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Groups
Pages
libraries
PowerSave
PowerSave.h
1
/*
2
* Copyright (C) 2012 Southern Storm Software, Pty Ltd.
3
*
4
* Permission is hereby granted, free of charge, to any person obtaining a
5
* copy of this software and associated documentation files (the "Software"),
6
* to deal in the Software without restriction, including without limitation
7
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
* and/or sell copies of the Software, and to permit persons to whom the
9
* Software is furnished to do so, subject to the following conditions:
10
*
11
* The above copyright notice and this permission notice shall be included
12
* in all copies or substantial portions of the Software.
13
*
14
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
* DEALINGS IN THE SOFTWARE.
21
*/
22
23
#ifndef PowerSave_h
24
#define PowerSave_h
25
26
#if defined(ARDUINO) && ARDUINO >= 100
27
#include <Arduino.h>
28
#else
29
#include <WProgram.h>
30
#endif
31
32
inline
void
unusedPin
(uint8_t pin)
33
{
34
pinMode(pin, INPUT);
35
digitalWrite(pin, HIGH);
36
}
37
38
enum
SleepDuration
39
{
40
SLEEP_15_MS
,
41
SLEEP_30_MS
,
42
SLEEP_60_MS
,
43
SLEEP_120_MS
,
44
SLEEP_250_MS
,
45
SLEEP_500_MS
,
46
SLEEP_1_SEC
,
47
SLEEP_2_SEC
,
48
SLEEP_4_SEC
,
49
SLEEP_8_SEC
50
};
51
52
void
sleepFor
(
SleepDuration
duration, uint8_t mode = 0);
53
54
#endif
Generated on Sun Sep 29 2013 09:30:46 for ArduinoLibs by
1.8.1.2