а батарейка подключена? эти часы без батарейки ничего не помнятolegue писал(а):При отключении внешнего питания время сбрасывается на время компиляции.
при взгляде на многих сверху ничего не меняется...
Мой уютный бложик... заходите!
а батарейка подключена? эти часы без батарейки ничего не помнятolegue писал(а):При отключении внешнего питания время сбрасывается на время компиляции.
Код: Выделить всё
#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);
}а чего вы еще хотели, если у вас ВСЕГДА при подаче питания отрабатывает это: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