Shop OBEX P1 Docs P2 Docs Learn Events
BOE-bot control with P.I.N.K — Parallax Forums

BOE-bot control with P.I.N.K

TEJATEJA Posts: 8
edited 2008-02-08 15:28 in General Discussion
HI...guys....can any one tell me....how one can acess..variables. in PINK module...continiously by BS2( with BOE_BOT)....

the code i used goes like this(in format...not actual syntax)





TX PIN 14
RX PIN 15
BAUD CON 396
nbvar VAR byte

main:

Do
SEROUT TX, Baud, [noparse][[/noparse]"!NB0R01"]
SERIN RX, Baud,[noparse][[/noparse]nbvar]

if nbvar=1 then HIGH 12
if nbvar=0 then LOW 12

LOOP
END




guys...i connected...an LED to pin 12...the problem is that....BS2 repeatedly reads values...from the P.I.N.K but....does not executes the IF conditions.....

plzzzzz do help me..its urgent






jumpin.gif

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-02-07 22:25
    If you enter an ASCII number 1 into a variable and then read that variable and compare to a binary value it will never match. Try:

    IF nbvar = “1” THEN HIGH 12

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • TEJATEJA Posts: 8
    edited 2008-02-08 15:28
    THANX a lot...CHRIS
Sign In or Register to comment.