PDA

View Full Version : This one is for Chris



Guido
05-02-2006, 07:00 AM
I am having a problem with a Basic Clock program. What I am trying to do is count the Hours and at a certain minute go do something. The problem I have is when I reach the setpoint the LCD drops off, and knocks off all saved information. I know it is the Minutes but just can not find a way to make it work.

X=Basically hours

IF X=70 AND MINUTES=$48 THEN MP

MP is a Moon Phase, that I am trying to incorporate into the scheme on the LCD
Thanks Guido

allanlane5
05-02-2006, 07:10 AM
Umm, $48 is 0x48 is 48 Hex. That's 16 * 4 + 8, which is 72. I wouldn't think a value named "Minutes" would go over 59 or 60.

Chris Savage
05-02-2006, 10:01 AM
Checking minutes for $48 should work since it is BCD. Not sure what X is, perhaps you should post your code?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Guido
05-02-2006, 10:21 AM
Chris,
X= total hours,
MOON:
IF FLAG1=1 THEN RETURN
IF MINUTES=$00 THEN DYCT
RETURN

DYCT:
X=X+1
X=X
FLAG1=1
RETURN

At 70 hours or X and 48 minutes I want to create a new Moon Phase. The problem I am having is the Minutes will lock up the LCD, when it reaches 48 minutes.I have no reason why.
X=70 (hours) and Minutes=$48 (minutes should let me proceed on the program, but it shuts the LCD down???????

Chris Savage
05-02-2006, 12:18 PM
More likely the code is locking up. You only posted a fraction of it. Not nearly enough to see what is happening. I noticed you're setting a flag to stop incrementing a counter...Do you ever clear the flag wheh the minute changes? Perhaps that's what is happening? Please attach the entire code for me to help you.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Guido
05-02-2006, 05:57 PM
Chris,
Yes I reset the Flag at Minutes=$01. One thing I guess I am not explaining very well is this. The LCD goes Blank for the peroid of one minute at 48 minutes. It looks like it loads the LCD down during this peroid. I even tried hooking up a LED as an output and it lights but is very dim....After the Minute it all goes back to running fine

Chris Savage
05-02-2006, 09:03 PM
Guido,

I can't stress enough that it is obviously something in the code, but without it nobody is going to be able to help you. It really sounds like you're asserting an I/O line somewhere that is fighting with something else. You must be doing something in or around that routine or related. Again, no code so it's impossible to tell. There's really nothing programmatically you can do with the LCD to cause such a problem. Although it is possible you're sending some sort of invalid characters to the LCD which is corrupting the display.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)