differentiating time
press9761
Posts: 6
Hello:
I'm looking for some suggestions on how differentiate time, not tell time.
Let me explain:
I am using a DS1302 to tell time. I am trying to delay my programs operation using the time. Let me give you a step-by-step example of what I'm trying to accomplish.
1. You press a button
2. An LCD will display “button press”-(let's say) for one second
3. one second has passed
4. the LCD will display something else.
Using the pause function is unacceptable. The program I am writing is very large and may not pause operation at any time.
The problem lies in the fact that I couldn't possibly know what time someone is going to press the button. So, the stamp would have to understand change from one second to the next. I cannot find a way to do this.
I hope someone has a suggestion. This is very frustrating for me.
Thank you
JP
I'm looking for some suggestions on how differentiate time, not tell time.
Let me explain:
I am using a DS1302 to tell time. I am trying to delay my programs operation using the time. Let me give you a step-by-step example of what I'm trying to accomplish.
1. You press a button
2. An LCD will display “button press”-(let's say) for one second
3. one second has passed
4. the LCD will display something else.
Using the pause function is unacceptable. The program I am writing is very large and may not pause operation at any time.
The problem lies in the fact that I couldn't possibly know what time someone is going to press the button. So, the stamp would have to understand change from one second to the next. I cannot find a way to do this.
I hope someone has a suggestion. This is very frustrating for me.
Thank you
JP
Comments
Buttonpressedroutine
buttontime=timefromDS1302
display LCD message
endbuttonroutine
mainloop
if buttontime is less than (timefromDS1302 minus one second) one second has passed so clear the LCD
.....
......
gotomainloop
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
how about.
write 000,secs
read 000,secs
if secs = secs+ 1 then.....
no, this wont work. secs is the time var so it will read the actual time on the RTC in the if/then
can I do,
secs= time
write 000,time
read 000, time
if time = secs +1 then......
no I can't ( I just tried it)
so...... this is killing me
BTW
that was a fast response!!!!!
thanks metron9 and jon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com