Skip to content

Commit 0c1ba8b

Browse files
committed
Merge pull request #84 from sandeepmistry/rtc-api
Rename CurieRTC to CurieTime and integrate some Processing/Time lib API's
2 parents 44bc8db + b3273bd commit 0c1ba8b

File tree

29 files changed

+245
-1940
lines changed

29 files changed

+245
-1940
lines changed

libraries/CurieRTC/examples/SetTime/SetTime.ino

-71
This file was deleted.

libraries/CurieRTC/readme.txt

-7
This file was deleted.

libraries/CurieRTC/src/CurieRTC.cpp

-42
This file was deleted.

libraries/CurieRTC/src/CurieRTC.h

-37
This file was deleted.

libraries/CurieRTC/examples/ReadTest/ReadTest.ino renamed to libraries/CurieTime/examples/ReadTest/ReadTest.ino

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
1-
#include <TimeLib.h>
2-
#include <CurieRTC.h>
1+
#include <CurieTime.h>
32

43
void setup() {
5-
Serial.begin(115200);
6-
delay(200);
7-
Serial.println("CurieRTC Read Test");
4+
while (!Serial);
5+
Serial.begin(9600);
6+
7+
Serial.println("CurieTime Read Test");
88
Serial.println("-------------------");
99
}
1010

1111
void loop() {
12-
tmElements_t tm;
13-
time_t t = RTC.get();
14-
breakTime(t, tm);
15-
1612
Serial.print("Ok, Time = ");
17-
print2digits(tm.Hour);
13+
print2digits(hour());
1814
Serial.write(':');
19-
print2digits(tm.Minute);
15+
print2digits(minute());
2016
Serial.write(':');
21-
print2digits(tm.Second);
17+
print2digits(second());
2218
Serial.print(", Date (D/M/Y) = ");
23-
Serial.print(tm.Day);
19+
Serial.print(day());
2420
Serial.write('/');
25-
Serial.print(tm.Month);
21+
Serial.print(month());
2622
Serial.write('/');
27-
Serial.print(tmYearToCalendar(tm.Year));
23+
Serial.print(year());
2824
Serial.println();
2925
delay(1000);
3026
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include <CurieTime.h>
2+
3+
void setup() {
4+
while (!Serial);
5+
Serial.begin(9600);
6+
7+
// set the current time to 14:27:00, December 14th, 2015
8+
setTime(14, 27, 00, 14, 12, 2015);
9+
}
10+
11+
void loop() {
12+
Serial.print("Time now is: ");
13+
14+
print2digits(hour());
15+
Serial.print(":");
16+
print2digits(minute());
17+
Serial.print(":");
18+
print2digits(second());
19+
20+
Serial.print(" ");
21+
22+
Serial.print(day());
23+
Serial.print("/");
24+
Serial.print(month());
25+
Serial.print("/");
26+
Serial.print(year());
27+
28+
Serial.println();
29+
30+
delay(1000);
31+
}
32+
33+
void print2digits(int number) {
34+
if (number >= 0 && number < 10) {
35+
Serial.print('0');
36+
}
37+
Serial.print(number);
38+
}

libraries/Time/keywords.txt renamed to libraries/CurieTime/keywords.txt

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#######################################
2-
# Syntax Coloring Map For Time
2+
# Syntax Coloring Map For CurieTime
33
#######################################
44

55
#######################################
66
# Datatypes (KEYWORD1)
77
#######################################
8-
time_t KEYWORD1
8+
99
#######################################
1010
# Methods and Functions (KEYWORD2)
1111
#######################################
@@ -16,15 +16,8 @@ hour KEYWORD2
1616
day KEYWORD2
1717
month KEYWORD2
1818
year KEYWORD2
19-
isAM KEYWORD2
20-
isPM KEYWORD2
21-
weekday KEYWORD2
2219
setTime KEYWORD2
23-
adjustTime KEYWORD2
24-
setSyncProvider KEYWORD2
25-
setSyncInterval KEYWORD2
26-
timeStatus KEYWORD2
27-
TimeLib KEYWORD2
20+
2821
#######################################
2922
# Instances (KEYWORD2)
3023
#######################################

libraries/CurieRTC/library.properties renamed to libraries/CurieTime/library.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name=CurieRTC
1+
name=CurieTime
22
version=1.0
33
author=Intel
44
maintainer=Intel <dino.tinitigan@intel.com>
5-
sentence=Curie RTC library.
5+
sentence=Curie Time library.
66
paragraph=
77
category=Timing
88
url=

libraries/CurieTime/readme.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Readme file for CurieTime Library
2+
3+
The CurieTime library is provided to demonstrate the Arduino101 Time library.
4+
5+
See the CurieTime example sketches provided with the Arduino101 Time library download for usage
6+
7+

0 commit comments

Comments
 (0)