File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ Breakout Carrier - BreakoutRTCGet
3+
4+ The sketch shows how to read the RTC of the PortentaH7 using the Breakout Carrier.
5+
6+ The circuit:
7+ - Portenta H7
8+ - BreakOut Carrier
9+ - CR2032 Battery
10+
11+ This example code is in the public domain.
12+ */
13+ #include < Arduino_PortentaBreakoutCarrier.h>
14+
15+ Timestamp utcTime;
16+
17+ void setup () {
18+ Serial.begin (9600 );
19+ while (!Serial);
20+ }
21+
22+ void loop () {
23+ // Read the current timestamp from the RTC
24+ utcTime = Breakout.RTClock .getTime ();
25+
26+ // Print the data
27+ Serial.println (utcTime.getUnixTimestamp ());
28+ Serial.print (" year: " );
29+ Serial.println (utcTime.year () + 1900 );
30+ Serial.print (" month: " );
31+ Serial.println (utcTime.month () + 1 );
32+ Serial.print (" day: " );
33+ Serial.println (utcTime.day ());
34+ Serial.print (" hours: " );
35+ Serial.println (utcTime.hour ());
36+ Serial.print (" minutes: " );
37+ Serial.println (utcTime.minute ());
38+ Serial.print (" seconds: " );
39+ Serial.println (utcTime.second ());
40+
41+ delay (1000 );
42+ }
You can’t perform that action at this time.
0 commit comments