Skip to content

Commit ac92535

Browse files
committed
DIRTY merge: Merge code from high power partitino into low power partition
* NOTE: several limitations have been observed: * Arduino Serial seems to be incompatibel with tickless light sleep mode --> check that in combination with other logging functions
1 parent c2f2c82 commit ac92535

13 files changed

+2494
-757
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Felix Biego
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# ESP32Time
2+
An Arduino library for setting and retrieving internal RTC time on ESP32 boards
3+
4+
[![arduino-library-badge](https://www.ardu-badge.com/badge/ESP32Time.svg?)](https://www.arduinolibraries.info/libraries/esp32-time)
5+
6+
## Functions
7+
8+
```
9+
setTime(30, 24, 15, 17, 1, 2021); // 17th Jan 2021 15:24:30
10+
setTime(1609459200); // 1st Jan 2021 00:00:00
11+
12+
getTime() // (String) 15:24:38
13+
getDate() // (String) Sun, Jan 17 2021
14+
getDate(true) // (String) Sunday, January 17 2021
15+
getDateTime() // (String) Sun, Jan 17 2021 15:24:38
16+
getDateTime(true) // (String) Sunday, January 17 2021 15:24:38
17+
getTimeDate() // (String) 15:24:38 Sun, Jan 17 2021
18+
getTimeDate(true) // (String) 15:24:38 Sunday, January 17 2021
19+
20+
getMicros() // (long) 723546
21+
getMillis() // (long) 723
22+
getEpoch() // (long) 1609459200
23+
getSecond() // (int) 38 (0-59)
24+
getMinute() // (int) 24 (0-59)
25+
getHour() // (int) 3 (0-12)
26+
getHour(true) // (int) 15 (0-23)
27+
getAmPm() // (String) pm
28+
getAmPm(true) // (String) PM
29+
getDay() // (int) 17 (1-31)
30+
getDayofWeek() // (int) 0 (0-6)
31+
getDayofYear() // (int) 16 (0-365)
32+
getMonth() // (int) 0 (0-11)
33+
getYear() // (int) 2021
34+
35+
getTime("%A, %B %d %Y %H:%M:%S") // (String) returns time with specified format
36+
```
37+
[`Formatting options`](http://www.cplusplus.com/reference/ctime/strftime/)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ESP32Time KEYWORD1
2+
3+
setTime KEYWORD2
4+
getTime KEYWORD2
5+
getTimeStruct KEYWORD2
6+
getDateTime KEYWORD2
7+
getTimeDate KEYWORD2
8+
getDate KEYWORD2
9+
getAmPm KEYWORD2
10+
getMillis KEYWORD2
11+
getMicros KEYWORD2
12+
getEpoch KEYWORD2
13+
getSecond KEYWORD2
14+
getMinute KEYWORD2
15+
getHour KEYWORD2
16+
getDay KEYWORD2
17+
getDayofWeek KEYWORD2
18+
getDayofYear KEYWORD2
19+
getMonth KEYWORD2
20+
getYear KEYWORD2
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "ESP32Time",
3+
"version": "1.0.3",
4+
"keywords": "Arduino, ESP32, Time, Internal RTC",
5+
"description": "An Arduino library for setting and retrieving internal RTC time on ESP32 boards",
6+
"repository":
7+
{
8+
"type": "git",
9+
"url": "https://github.com/fbiego/ESP32Time"
10+
},
11+
"authors":
12+
[
13+
{
14+
"name": "fbiego",
15+
"email": "[email protected]",
16+
"maintainer": true
17+
}
18+
],
19+
"frameworks": "arduino",
20+
"platforms": "espressif8266, espressif32"
21+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name=ESP32Time
2+
version=1.0.3
3+
author=fbiego
4+
maintainer=fbiego
5+
sentence=Set and retrieve internal RTC time on ESP32 boards.
6+
paragraph=No need for external RTC module or NTP time synchronization.
7+
category=Timing
8+
url=https://github.com/fbiego/ESP32Time
9+
architectures=*
10+
includes=ESP32Time.h
11+

0 commit comments

Comments
 (0)