char* daysOfWeek[] = "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat";
| Feature | VirtuabotixRTC | Adafruit RTClib | | :--- | :--- | :--- | | | ~3KB Flash, low RAM | ~7KB+ Flash | | Ease of Use | Very easy (Int variables) | Moderate (DateTime object) | | Timestamp support | No (manual conversion) | Yes (unixtime) | | Alarm features (DS3231) | No | Yes | | Temperature reading | No | Yes (DS3231 only) | | Best for | Beginners, small MCUs | Complex dataloggers |
Used to write the time to the RTC chip. You must call this only once (usually in setup() ) after inserting the battery into the module.
Try the example sketch: File → Examples → VirtuabotixRTC → SetTimeAndDisplay
// Include the library #include <virtuabotixRTC.h>
// print formatted Serial.print(hour); Serial.print(":"); if(minute < 10) Serial.print("0"); Serial.print(minute); Serial.print(":"); if(second < 10) Serial.print("0"); Serial.print(second); Serial.print(" "); Serial.print(month); Serial.print("/"); Serial.print(day); Serial.print("/"); Serial.println(year);
char* daysOfWeek[] = "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat";
| Feature | VirtuabotixRTC | Adafruit RTClib | | :--- | :--- | :--- | | | ~3KB Flash, low RAM | ~7KB+ Flash | | Ease of Use | Very easy (Int variables) | Moderate (DateTime object) | | Timestamp support | No (manual conversion) | Yes (unixtime) | | Alarm features (DS3231) | No | Yes | | Temperature reading | No | Yes (DS3231 only) | | Best for | Beginners, small MCUs | Complex dataloggers |
Used to write the time to the RTC chip. You must call this only once (usually in setup() ) after inserting the battery into the module.
Try the example sketch: File → Examples → VirtuabotixRTC → SetTimeAndDisplay
// Include the library #include <virtuabotixRTC.h>
// print formatted Serial.print(hour); Serial.print(":"); if(minute < 10) Serial.print("0"); Serial.print(minute); Serial.print(":"); if(second < 10) Serial.print("0"); Serial.print(second); Serial.print(" "); Serial.print(month); Serial.print("/"); Serial.print(day); Serial.print("/"); Serial.println(year);