Real Time Clock1 RTC(Real Time Clock) - DS3231 #include #define SCK_PIN 4 #define IO_PIN 3 #define RST_PIN 2 DS1302 rtc(RST_PIN, IO_PIN, SCK_PIN); void setup() { rtc.halt(false); rtc.writeProtect(false); Serial.begin(9600); /* rtc.setDOW(THURSDAY); rtc.setTime(8, 43, 0); rtc.setDate(2, 9, 2021); /**/ } void loop() { Serial.print("It is "); Serial.print(rtc.getDOWStr()); Serial.print(" / "); Serial.print(rtc.getDateStr()); Serial.print(" / ").. 아두이노 2022. 1. 18. 이전 1 다음