Switches to change time and date on LCD
Shalini
Posts: 59
Hello everyone!!
It's great that I got the time and date to display on JHD162A 16x2 LCD. The clock now running in 12hr-mode. Now I want to use 6 pushbuttons to change the time and date on the LCD...Can anybody help?? I've included the codes for you to take a look...
Thanks in advance
It's great that I got the time and date to display on JHD162A 16x2 LCD. The clock now running in 12hr-mode. Now I want to use 6 pushbuttons to change the time and date on the LCD...Can anybody help?? I've included the codes for you to take a look...
Thanks in advance
Comments
You should do some of the work on YOUR project after all!
It seems like you want someone to develop your entire project for you with little understanding and work from you.
Study the code people have provided if you really want to learn...
sorry about that, yes i forgot to cancel this post...yes it is working as both modes...thank you
now I want to add 6 switches to change the time and date using the switches instead of changing them in the code and downloading them each time I want to update the rtc with new data. And yes I'm doing my best to learn the code, but I also have to get the project to work in the next 2 weeks, so please do bare with me.... I'm learning spin only last 3 weeks and I'm not upto the level to do my own code.
I hate to say it, but if you are not able to do some of the coding yourself, what's the point??
I can do some basic coding like writing strings, declaring variables and stuff...that's it. This is the last help I need, please help me!!!
If you do want to learn how to program microcontrollers, then like others have said, a good place to start is by reading the fine manual. Spending only a matter of minutes going through spin lesson 1 of the spin programming tutorial available through the help menu (F1) for the Propeller tool would've made clear how objects are loaded into the Propeller: how top object files load included objects, which would've saved quite a bit of time earlier. The DS1307 datasheet has an entire paragraph describing how to set 12-hour mode. And there are countless examples of how to interface a pushbutton switch to a program.
Ok I'll work on the code with 2 switches. I'm going to look all the examples and if I have any critical issues I'll contact.
thanks
I was looking at the LCD clock 2 program u had given...can you please explain what these lines below do...
case field
0:
if ++buffer[date] & $0F == $0A
buffer[date] := (buffer[date] & $F0) + $10
if buffer[date] > $31
buffer[date] := 1
This program does not check for invalid dates; February 31st is perfectly valid as far as it's concerned, though according to the clock datasheet 'Illogical time and date entries result in undefined operation,' so that's on the user.
The month, year, and minutes fields operate the same as the date field, hours is made more complicated as it has to toggle the am/pm bit when going from 11 to 12, and preserve it otherwise, as well as preserving the 12-hour bit.
ok, thank you I get it now.
repeat
waitcnt(cnt + clkfreq)
I2C.read_page(I2C#RTC,Seconds,@buffer,7)
LCD.move(1,1)
LCD.str(string("DATE: "))
LCD.hex(buffer[date],2)
LCD.str(string("/"))
LCD.hex(buffer[month],2)
LCD.str(string("/"))
LCD.hex(buffer[year],2)
LCD.move(1,2)
LCD.str(string("TIME: "))
LCD.hex(buffer[hours],2)
LCD.str(string(":"))
LCD.hex(buffer[minutes],2)
LCD.str(string(":"))
LCD.hex(buffer[seconds],2)
LCD.str(string(" "))
help please!!!
-Android
Alright, you say that LCD clock - basic from the first post works? If that's the case, then this one should work. The same as LCD clock - basic, with the display format you want
And if that one works, this one should also work. The same as LCD clock - basic 2, with the display routine moved to a separate method
And if that one works, this one should work, too. The same as LCD clock - basic 3, with some switches connected to IO pins 20 through 25, as per your schematic, that display simple messages.
And finally, if all of those work, this one had better work. The same as LCD clock - basic 4, except now each switch increments one field of the clock.
Be sure to use the same LCD_8x2_4bit driver that you've been having success with for these.
This happens to me very frequently.
What I do is:
1 -Check my physical circuit yet again.
2 -Check my battery or power supply again.
3 - Load an early version of the program that worked as I had expected.
4 - If my early program worked, then I will progressivly load later versions until I find the one that does not work.
5 - I compare the last program that worked against the one that does not work.
Usually that leads me to a solution.
You may already do this type of thing, but sometimes it's difficult to go through the steps because
You've already been there.
That's just my two cents worth.
I hope it helps you on your quest.