Shop OBEX P1 Docs P2 Docs Learn Events
This one is for Chris — Parallax Forums

This one is for Chris

GuidoGuido Posts: 195
edited 2006-05-02 14:03 in BASIC Stamp
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
·

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-05-02 00:10
    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-02 03:01
    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
  • GuidoGuido Posts: 195
    edited 2006-05-02 03:21
    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-02 05:18
    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
  • GuidoGuido Posts: 195
    edited 2006-05-02 10:57
    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-02 14:03
    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
Sign In or Register to comment.