Yup, same result, it doesn't work.
If you put an lcd.print("hello world") in setup followed by a long delay, can you see the output on the LCD?
fwiw, the code I am running here is still working perfectly, so would be interested to find out what is different in your tests.
OK, this is just mad.
First change, added:
lcd.print("hello world");
delay(10000);
to setup(). That was displayed just fine.
Next I removed the Serial.println("");, but now the "hello world" message gets displayed but the first two characters are corrupted, but the time gets displayed OK.
Almost seems like there is a buffer that is being created but not initialised correctly.
Here is the current state of my code:
#include <LiquidCrystal.h>
#include <WProgram.h>
#include <Wire.h>
#include <DS1307.h>
int rtc[7];
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
// Uncomment these lines if you want to set the time on startup
/*
RTC.stop();
RTC.set(DS1307_SEC,0);
RTC.set(DS1307_MIN,26);
RTC.set(DS1307_HR,15);
RTC.set(DS1307_DOW,6);
RTC.set(DS1307_DATE,29);
RTC.set(DS1307_MTH,11);
RTC.set(DS1307_YR,9);
RTC.start();
*/
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
lcd.print("hello world");
delay(10000);
}
char* dayOfWeek[] = {"xxx", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
void loop()
{
RTC.get(rtc,true);
lcd.setCursor(0,0);
//lcd.print(millis());
printDigits(rtc[2],':');
printDigits(rtc[1],':');
printDigits(rtc[0],' ');
lcd.print(dayOfWeek[rtc[3]]);
lcd.setCursor(0,1);
printDigits(rtc[4],'/');
printDigits(rtc[5],'/');
printDigits(rtc[6],' ');
//Serial.println("");
delay(100);
}
void printDigits(int digits, char delimiter)
{
if(digits < 10) {
lcd.print('0');
}
lcd.print(digits,DEC);
lcd.print(delimiter);
}
If I change "hello world" to ".", it displays a double bar symbol for 10 seconds, then the dayOfWeek is corrupted and becomes a double bar. If I change it to ".,", then I get two corrupt characters for 10 seconds then the main loop displays mostly garbage which bears a slight resemblance to the time and date. ".,/" goes back to a basically blank screen. "hello" performs the same as "hello world".
This is insane!
I think I'm going to try using a different computer, I'm wondering if there is an incompatibility with W7x64 RC1 somewhere. I'll give it a go on my XP based netbook tomorrow sometime. The fact that adding or removing code from loop() is affecting code running in setup() just strikes me as ridiculous unless there is a compiler problem/incompatibility somewhere.
Since the code is being executed on an Arduino, and displayed on an LCD, I fail to see how compiling the code on a different computer will make any difference.
However, I will be interested in hearing whether that makes any difference.
The Serial.println should not do anything, because you don't have a Serial.begin statement. Serial.println should (but maybe doesn't) know whether or not Serial.begin was called, and do absolutely nothing if it wasn't.
If there was a bug or incompatibility in the compiler/IDE/USB drivers then that could quite easily affect the way the code was compiled and uploaded to the Arduino. If the code is compiled wrong, then anything could happen.
I am new to this forum, i am building some stuff for home use.
One of the things i had troubles, was the LCD.
As i watch this topic, there is a similar problem i had too.
If I change "hello world" to ".", it displays a double bar symbol for 10 seconds, then the dayOfWeek is corrupted and becomes a double bar. If I change it to ".,", then I get two corrupt characters for 10 seconds then the main loop displays mostly garbage which bears a slight resemblance to the time and date. ".,/" goes back to a basically blank screen. "hello" performs the same as "hello world".
My LCD did not show anything, i also have the DS1307. My problem was simple the power of the LCD, if you get 00:00:00 time and date or garbage caracters, then it meant in my case that the needed power to the DS1307 is too short, because the LCD used too much.
I solved this with a second 7805 i added for the lcd and the trouble was gone. I had the same troubles, first a few seconds time and date and after some seconds garbage.
That is maybe, i think for 100% the trouble in this case.
I use this forum to get solutions.
I hope this will solve your LCD troubles.