Alarm clock DS1302 + Serial LCD
Hello everyone, me again 
I bought the Serial LCD with backlit, its amazing.
I pickeup the example from stampworks where they build a clock with 4 push buttons and i adapted it to display hour and day in the LCD. Its uses one button for minutes, one for hours and one for the day.
I want to use the fourth button to acces into an alarm mode and using the same hour and minute button i can set an alarm adn after alarm is done, use the same fourth button to go back into the time mode. Here is where i'm stucked, i need to set this up and keep the time runing in the clock. I have no problem setting a LED or a buzz when the time and the alarm time are equal.
I hope you can understand what i want, my english isn't perfect.
I'm trying to make it show the temperature too, but i almost got it. I think i can do the temp code works.
Any code help its really welcome.
Thanks everyone.
Post Edited (What) : 6/24/2008 5:47:39 PM GMT

I bought the Serial LCD with backlit, its amazing.
I pickeup the example from stampworks where they build a clock with 4 push buttons and i adapted it to display hour and day in the LCD. Its uses one button for minutes, one for hours and one for the day.
I want to use the fourth button to acces into an alarm mode and using the same hour and minute button i can set an alarm adn after alarm is done, use the same fourth button to go back into the time mode. Here is where i'm stucked, i need to set this up and keep the time runing in the clock. I have no problem setting a LED or a buzz when the time and the alarm time are equal.
I hope you can understand what i want, my english isn't perfect.
I'm trying to make it show the temperature too, but i almost got it. I think i can do the temp code works.
Any code help its really welcome.
Thanks everyone.
Post Edited (What) : 6/24/2008 5:47:39 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I've been working really hard and i had some progress, and now have a little problems with serout and LCD.
Problem 1:
As you can see on the picture attached (sorry for bad quality) i have the time, day and temp in ºC on line 1. Then when i press a button the program must show just the words "d/m/y" but when i hit the button, the program also show the actual day after the "y" ( i mean its show d/n/yDO").
I don't know why this its happening, any idea?
Problem 2:
I think that this lines get the time and day from DS1302, how can i get the date from it?
Thanks all for your time and help.
In your case the day, month and year are all lost into one variable (only the last value is valid).
Also, the reason your code shows d/m/y is because you have a line of code sending that to the display. Your code is doing exactly what it programmed to. I would recommend checking out the DS1302 Demo Code at the following link.
http://forums.parallax.com/showthread.php?p=531080
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
http://forums.parallax.com/showthread.php?p=733345
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
With a lot of help i have my code runing perfect. The program read the time, date, temp, and alarm time from the debug console, then it shows the information in the LCD. The alarm its working perfect too.
Then i found a code name EX30. Its a clock code using 4 push buttons but they only works on setting up the time. I tried to adapt the button code from this to my own code, but i always get this error: "Out of Variable space".
Obviously i think its because i have too many VAR defined, but if that is the case, it should be impossible to make it works keeping date, alarm and temperature? If i remove some variables it means to no show temp, date, etc?
Thanks for your time.
E. G.
Var1 var byte
Var2 var Var1
With this definition, both Var1 and Var2 are assigned to the same RAM location. As long as they are both used in different sections of the code and you set both of them in their respective sub-routines, then the RAM space can be re-used.
One other option you might consider, is that the DS1302 has a small amount of RAM available. It can't be used for variables, but it can be used to build the data string you are sending to the LCD. You collect the data in RAM and then using a single byte variable, write it to the LCD on piece at a time.
I haven't used the serial LCD, but have been able to send long strings of characters to other serial devices using this technique.
I have another question, i need to make something like this (isn't a code, just like a pseudocode of what i'm trying)
I hope someone can understand what i'm trying to do.
Thanks.