Shop OBEX P1 Docs P2 Docs Learn Events
converting BS1 code to BS2 — Parallax Forums

converting BS1 code to BS2

Nick WaldvogelNick Waldvogel Posts: 71
edited 2006-07-07 02:02 in BASIC Stamp
I hope this is a simple question. Does the code below make sence the way I conveted it??

The BS1 Code:

symbol dat = b2
symbol synch = b3
symbol junk = b4
synch = "A"
junk = 126

start:
pause 1000
for dat = 1 to 255
serout 0,N2400,(junk,synch,dat)
pause 50
next
serout 0,N2400,(junk,synch,0)
goto start

The BS2 Code:

dat VAR Byte
synch VAR Byte
junk VAR Byte
synch = "A"
junk = 126
BAUD CON 16780 'N2400 baud (MAX)


start:
PAUSE 1000
FOR dat = 1 TO 255
SEROUT 0,BAUD,[noparse][[/noparse]junk,synch,dat]
PAUSE 50
NEXT
SEROUT 0,BAUD,[noparse][[/noparse]junk,synch,0]
GOTO start

I'm using this code for a pair of TWS-434 RF transmitter, and RWS-434 RF receiver. I can't seem to get it right and the receiver is just turning on the LED's at random. Thanks for your help!

Nick

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm just 10 people short of a threesome!!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-07-07 02:02
    Nick,

    ·· The conversion looks fine.· What data are you getting for what you send?· Are you sure the data is inverted?· Have you tried true baud mode (396)?·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.