Shop OBEX P1 Docs P2 Docs Learn Events
undefined symbol ? — Parallax Forums

undefined symbol ?

PodionPodion Posts: 90
edited 2011-07-18 04:10 in BASIC Stamp
Hi all,

{$STAMP BS2}
' {$PBASIC 2.5}
on1  VAR Byte

start:
DO
  DEBUG CLS
  DEBUGIN DEC on1


Main:
    IF (on1 = W ) THEN LEDON
    LOW 0
    PAUSE 500
    LOOP

LEDON:
      HIGH 0
      PAUSE 500
      GOTO start
'

the BS2 tell me " undefined symbo " for the "W" character

the program work whit numbers but i need to use letters for this ... do you have a idea how can i solve this problem?

this program is just a little demo my real project is to control 2 servo whit the "W = forward , A = Left , S = backward, D = Right" character like in the most game...
And it could serve to make a password to..

Comments

  • LeonLeon Posts: 7,620
    edited 2011-07-18 04:06
    I don't use BASIC, but I think that you should use 'W' instead of W, if it is a key you are pressing.
  • xanatosxanatos Posts: 1,120
    edited 2011-07-18 04:10
    Leon is crrect, the W needs to be in quotes, else the program thinks the W is an undefined variable.
Sign In or Register to comment.