here is what i run
Code: Select all
// DS1307_LCD (C)2010 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// A quick demo of how to use my DS1307-library to make a quick
// clock using a DS1307 and a 16x2 LCD.
//
// I assume you know how to connect the DS1307 and LCD.
// DS1302: SDA pin -> Arduino Digital 4
// SCL pin -> Arduino Digital 5
// LCD: DB7 -> Arduino Digital 6
// DB6 -> Arduino Digital 7
// DB5 -> Arduino Digital 8
// DB4 -> Arduino Digital 9
// E -> Arduino Digital 10
// RS -> Arduino Digital 11
#include <LiquidCrystal.h>
#include <DS1307.h>
// Init the DS1307
DS1307 rtc(20, 21);
// Init the LCD
LiquidCrystal lcd(8,9, 4, 5, 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);
}
and on the screen i get
middle of first line 27:85:85
bottom line XXX 85.85.2165
i think some think is being kept in memory somewhere as this is part of the screen from the program i put in the other day .
can the memory be cleared or it this just coincidence,
i have just checked the 1302 clock and i get the same as above when i run the clock program that worked before.