Плата реального времени DS 1302
#include <DS1302.h> //Подключаем библиотеку реального времени
DS1302 rtc(12, 11, 10); //RST,CLK,DAT
void setup()
{
rtc.halt(false);
rtc.writeProtect(false);
Serial.begin(9600);
//Настраиваем часы реального времени
rtc.setDOW(FRIDAY); // Set Day-of-Week to FRIDAY
rtc.setTime(21, 14, 0); // Set the time to 12:00:00 (24hr format)
rtc.setDate(20, 11, 2020); // Set the date to August 6th, 2010
}
void loop()
{
// Send Day-of-Week
// Serial.print(rtc.getDOWStr());
// Serial.print(" ");
// Send date
// Serial.print(rtc.getDateStr());
// Serial.print(" -- ");
// Send time
Serial.println(rtc.getTimeStr());
// Wait one second before repeating :)
delay (100);
}