Shop OBEX P1 Docs P2 Docs Learn Events
BS2 serin,serout. — Parallax Forums

BS2 serin,serout.

chickchick Posts: 16
edited 2007-04-05 17:15 in BASIC Stamp
I have two bs2s attached together for comunication. The program is very simple as yet, but a strange problem exist. When transmitting a var. that is from 1-5, the reciever debug shows 1 as 1, 2 as 0,3 as 1, 4 as 0, 5 as 1.
Odd numbers =1 and even =0

Here are the codes:

transm.

PTNUMBER:
HIGH 1
SEROUT 1,16780,[noparse][[/noparse]f,f,f]
PAUSE 10
RETURN

reciev.

PTNUMBER:
SERIN 9,16780,100,MAIN1,[noparse][[/noparse]z,j,z]
RETURN


Thanks, Lou

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2007-04-05 17:00
    Yeah, you don't want that "HIGH 1" up there -- that will look like a 'start bit' to the recieving device.

    The SEROUT command does it's own start bit.
  • chickchick Posts: 16
    edited 2007-04-05 17:15
    Yes, thank you, I'll remove the high. But I found the problem and it was stupider than you would think. I had the var as a bit. in the main program, changed it to a byte and works fine.

    thanks,

    Lou
Sign In or Register to comment.