As per that thread, I just burned a sketch onto an Atmega168 that should display "Uptime = xxx" on an lcd (uptime being seconds that the atmega has been running. The LCD works great, but the time is erratic.. sometimes a second is short, sometimes it's long. I assume it's a timing issue, but I'm unsure how to troubleshoot the problem. Any suggestions?
Ok so with the following code the LED appears to go on for a second/off for a second but the count on the LCD isn't accurate. It's as if the millis() function isn't functioning properly.
I believe that the final argument to itoa() is the base (radix), not the string length. If so, your numbers would be printing out in base 5: 0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 20, etc.
Change the final argument to 10. Also, increase your length of millistring[] to 10 or 20. Don't be too stingy with the bytes.