03-23-2023, 01:22 AM
(This post was last modified: 03-23-2023, 01:27 AM by KinCony Support.)
[Arduino source code for KC868-AIO]-02 DS3231_RTC
Code:
// KC868-AIO RTC CODE DS3231
#include <Wire.h>
#include <DS3231.h>
RTClib myRTC;
void setup () {
Serial.begin(115200);
Wire.begin(4,16);
delay(500);
}
void loop () {
delay(1000);
DateTime now = myRTC.now();
Serial.printf("%d:%d:%d--%d:%d:%d\n",now.year(),now.month(),now.day(),now.hour(),now.minute(),now.second());
}