NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Printing today date on LCD

July 25, 2010
by ssnirgudkar
ssnirgudkar's Avatar

Hello,

How can I print today's date on LCD ? I have USB nerdkit. I went through their timer example ( which counts seconds from the bootup ) and few forum threads but could not find any discussion on this topic.

regards, shailesh

July 26, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi ssnirgudkar,

I am very happy to see you diving straight into your NerdKit. Displaying the current date and time on your LCD requries a little bit of outside help because the the little chip has no way of knowing what time it is when it boots up. It does not have an internal clock, or access to that information from the internet like your comptuer does. What you can do however is read that information in from your computer. The most straight forward way I can see of having a current time on your NerdKit is to write a quick Python script to send the current date and time to your NerdKit. There are a couple of examples in our video tutorials of us sending data from the computer to the chip. We do this using Python in our Multi-Panel LED Array.

While the actual idea is sort of simple there are lots of things involved in doing this. You have to install python with the correct modules, write the pyhton script, decode the date on your NerdKit, and get it to the LCD. Keep in mind that all this is pretty complicated stuff. Take it slow and one step at a time, and let us know if you run into any problems!

I hope you are enjoying your NerdKit.

Humberto

July 26, 2010
by ioScream
ioScream's Avatar

If I were to do it (which I am).. I would do all the decoding on the Python side, so that you don't take away from the overhead on the MCU. It appears that the space available on the chip can fill up quickly. Plus Python can handle a lot with little effort, though doing this on the chip would be great practice with C and MCU programming.

July 27, 2010
by hevans
(NerdKits Staff)

hevans's Avatar

Hi ioScream,

In this case, with something like date/time it makes more sense to have python do the formatting of the date. With python you can very easily output the date in any format and just send it down to the MCU as a string. It might be a tad bit longer to transfer, but the ease of formatting is worth it.

Humberto

July 27, 2010
by Ralphxyz
Ralphxyz's Avatar

Foregoing the PC one could also use a clock chip to send the date to the MCU.

Ralph

Post a Reply

Please log in to post a reply.

Did you know that the sparks present in motors can be dangerous for your microcontroller and other electronics? Learn more...