Shop OBEX P1 Docs P2 Docs Learn Events
Does not add up ? ? ? — Parallax Forums

Does not add up ? ? ?

kenwtnkenwtn Posts: 250
edited 2008-06-06 01:06 in BASIC Stamp
Hi All,

· I put the following lines in my program and things just do not add up, any ideas?

· DEBUG CR, DEC CmdParm
· DEBUG CR, DEC M_Stop
· M_Speed = CmdParm + M_Stop
· DEBUG CR, DEC M_Speed

I get the following:

150
750
138

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-06-06 00:59
    Read up on variables in reference to Byte and Word. That just might be your problem but since you didn't attach your code I can't tell.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • kenwtnkenwtn Posts: 250
    edited 2008-06-06 01:03
    M_Stop CON 750 'Motor Full Stop
    M_Speed VAR BYTE 'Motor Speed
    CmdParm VAR WORD

    This is how variables are defined
  • kenwtnkenwtn Posts: 250
    edited 2008-06-06 01:06
    M_Stop CON 750 'Motor Full Stop
    M_Speed VAR WORD 'Motor Speed
    CmdParm VAR WORD

    Thanks this fixed the problem
Sign In or Register to comment.