Clock 2.0

It is clock 2.0 because it is the second version I have made (well third if you include the alteration of the GLCD Clock demo, I don't)

It has time, date and an alarm (perhaps more in future) and settings can be accessed with a menu system. Four buttons are used, Up, Down, OK and Back.

The code is in this .zip file, and I used AVR Project IDE, but the file extensions are standard.

Here is a video for your viewing pleasure too, sorry about the focus it is the only camera I have access to. :(


Great graymalkin!!

In fact i am involve in a similar project: I use a 128x64 GLCD and thenew beta version of the GLCD library.

At this moment i saw date, time, and alarms, but also sunset, sunrise, moonphase, temperature/humidity/pressure, day of the year, weeknumber, and in a nearest future: special days (newyear, christmas, and so on), and probably more things...

I am now working on the buttons and setting menus...

So nice to read about your project. It will provide a lot of ideas to me. Thanks!

Yeah, menus seem to work the best with a list then an arrow to the left. Good idea with the moon phase and sunrise/sunset times. I can’t add temp and humidity, ran out of IO :frowning:

Yes, this is also my pain.... i have some free pins thanks that i am working on use only one analog pin for all the buttons, by the use of this idea:

Then, two pins for SH15 provide temperature and humidity. And i am working on place in digital 0 and 1 pins the pressure sensor... but i am working on that.

The other options are based on code, so it is perfect because it does not consume pins...


I have considered using some i2c devices, eg an io exteneder and a ds1307 chip, and some other things like that as they only need two IO pins (SDA and SCK) even with multiple devices through addressing. Could get complex quickly though… It’s only opposed to be an alarm clock… It took me long enough to add the game of life (compiler didn’t like it, so I tricked it… Then it gave weird error messages that didn’t relate to the error)

Who knew that avr-Gcc could be quite so ambiguous?! Why say “left hand operand requires lvalue in increment or decrement” when what it really means is “don’t reasign that constant integer that got put in sneakily by some library you’re using” !!! it took me literally hours to figure out what was going on.

Also, anyone got a clue how to work out moon phase? I googles it and found an algorithm, but it didn’t work and gave me silly results, add one to the day and it jumped back 3 phases (of 8)…

I have the moonphase correctly working in my project. Give me a couple of days to post here the code of this function, please (i dont´ahve it in this computer...)


Awsome, thanks.