Skip to content

Commit a107dea

Browse files
committed
Add RTC set example
1 parent 14f3ce2 commit a107dea

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
Breakout Carrier - BreakoutRTCSet
3+
4+
The sketch shows how to configure 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+
// Configure UTC timestamp
21+
utcTime.setFromUnixTimestamp(1618234648);
22+
// Store the timestamp into the RTC
23+
Breakout.RTClock.setTime(utcTime);
24+
}
25+
26+
void loop() {
27+
delay(1000);
28+
}

0 commit comments

Comments
 (0)