Smart Home Automation Forum

Full Version: [Arduino source code for KC868-AIO]-02 DS3231_RTC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[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());

   
}