Пн окт 05, 2020 15:17:01
а батарейка подключена? эти часы без батарейки ничего не помнятolegue писал(а):При отключении внешнего питания время сбрасывается на время компиляции.
Пн окт 05, 2020 15:21:31
Пн окт 05, 2020 16:07:10
#include <LiquidCrystal.h>
#include <DS1307.h>
// Init the DS1307
DS1307 rtc(A4, A5);
// Init the LCD
//LiquidCrystal lcd(11, 10, 9, 8, 7, 6);
LiquidCrystal lcd(12, 11, 5, 4, 6, 7);
void setup()
{
// Set the clock to run-mode
rtc.halt(false);
// Setup LCD to 16x2 characters
lcd.begin(16, 2);
// The following lines can be commented out to use the values already stored in the DS1307
rtc.setDOW(SUNDAY); // Set Day-of-Week to SUNDAY
rtc.setTime(12, 0, 0); // Set the time to 12:00:00 (24hr format)
rtc.setDate(3, 10, 2010); // Set the date to October 3th, 2010
// Set SQW/Out rate to 1Hz, and enable SQW
rtc.setSQWRate(SQW_RATE_1);
rtc.enableSQW(true);
}
void loop()
{
// Display time centered on the upper line
lcd.setCursor(4, 0);
lcd.print(rtc.getTimeStr());
// Display abbreviated Day-of-Week in the lower left corner
lcd.setCursor(0, 1);
lcd.print(rtc.getDOWStr(FORMAT_SHORT));
// Display date in the lower right corner
lcd.setCursor(6, 1);
lcd.print(rtc.getDateStr());
// Wait one second before repeating :)
delay (1000);
}
Пн окт 05, 2020 16:11:08
а чего вы еще хотели, если у вас ВСЕГДА при подаче питания отрабатывает это:olegue писал(а):Все то же самое
// The following lines can be commented out to use the values already stored in the DS1307
rtc.setDOW(SUNDAY); // Set Day-of-Week to SUNDAY
rtc.setTime(12, 0, 0); // Set the time to 12:00:00 (24hr format)
rtc.setDate(3, 10, 2010); // Set the date to October 3th, 2010
Пн окт 05, 2020 17:28:40
Пн окт 05, 2020 20:12:20
Чт дек 01, 2022 12:02:49
Чт дек 01, 2022 12:51:18
Чт дек 01, 2022 13:19:27
Чт дек 01, 2022 13:34:51
Чт дек 01, 2022 13:40:29
Чт дек 01, 2022 14:22:49
Пт дек 02, 2022 11:43:59
Вт ноя 28, 2023 11:23:04
Вт ноя 28, 2023 14:26:37
Ср ноя 29, 2023 06:14:45