Skip to content

Commit a086f96

Browse files
authored
Merge pull request #48 from sebromero/rtc-example-compatibility
Make RTC sketch compatible with UNO R4 WiFi
2 parents c918460 + 15b9596 commit a086f96

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

libraries/RTC/examples/RTC_NTPSync/RTC_NTPSync.ino

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
/**
2-
* This example shows how to set the RTC (Real Time Clock) on the Portenta C33
2+
* This example shows how to set the RTC (Real Time Clock) on the Portenta C33 / UNO R4 WiFi
33
* to the current date and time retrieved from an NTP server on the Internet (pool.ntp.org).
44
* Then the current time from the RTC is printed to the Serial port.
55
*
66
* Instructions:
77
* 1. Change the WiFi credentials in the arduino_secrets.h file to match your WiFi network.
8-
* 2. Upload this sketch to Portenta C33.
8+
* 2. Upload this sketch to Portenta C33 / UNO R4 WiFi.
99
* 3. Open the Serial Monitor.
1010
*
1111
* Initial author: Sebastian Romero @sebromero
1212
*/
1313

1414
#include "RTC.h"
15+
16+
#if defined(ARDUINO_PORTENTA_C33)
1517
#include <WiFiC3.h>
18+
#elif defined(ARDUINO_UNOWIFIR4)
19+
#include <WiFiS3.h>
20+
#endif
21+
1622
#include <WiFiUdp.h>
1723
#include "arduino_secrets.h"
1824

0 commit comments

Comments
 (0)