Shop OBEX P1 Docs P2 Docs Learn Events
Expected A Label — Parallax Forums

Expected A Label

LutamosLutamos Posts: 26
edited 2009-03-02 23:32 in BASIC Stamp
HI!!

I have the parallax serial 2x16 LCD displaying readings from the DS1620 Digital thermometer. Also I want it to display the next reading of the thermometer, but it gets this "Expected a label" error on a "IF seconds = 60 then seconds = 0:" Command. What does that mean and how can I fix it. I attached the code of what I am playing with to this post, hope you guys can help me.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thank, you
Lutamos

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-03-02 23:24
    IF...THEN wants you to GOTO or GOSUB to a subroutine.

    IF seconds = 60 THEN GOTO clear_seconds

    ...

    clear_seconds:
    · seconds = 0
    · GOTO somewhere
  • LutamosLutamos Posts: 26
    edited 2009-03-02 23:30
    Awesome awesome awesome that fix the issue !!!! Thank you

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thank, you
    Lutamos
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-02 23:32
    IF seconds = 60 THEN seconds = 0

    This line is valid. But you added another piece of code after the colon. A cleaner way to do what you did would be:

    IF second = 60
      seconds = 0
      minutes = minutes + 1
    ENDIF
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
Sign In or Register to comment.