I need help!!!! wireless code not work

Status
Not open for further replies.

loard

New Member
Hello, Iam trying to control boe bot using PC keyboard via wireless tx/rx 434
I have this code for TX:
' {$STAMP BS2}
' {$PBASIC 2.5}

TX PIN 0 ' transmitter

synch CON "A"
Baud CON 16780 ' Baud set at 9600

code VAR Word

dirChar VAR Word ' Stores directional character



DO

IF (dirChar = "8") OR (dirChar = "w") THEN
GOSUB Operation1


ELSEIF (dirChar = "2") OR (dirChar = "x") THEN
GOSUB Operation2

ELSEIF (dirChar = "4") OR (dirChar = "a") THEN
GOSUB Operation3

ELSEIF (dirChar = "6") OR (dirChar = "d") THEN
GOSUB Operation4

ENDIF
LOOP

Operation1:
code = 11013
RETURN

Operation2:
code = 21013
RETURN

Operation3:
code = 31013
RETURN

Operation4:
code = 41013
RETURN

Transmit:
SEROUT 0,baud,[(synch),DEC code] 'This sends the junk, followed by the synch'
RETURN

and for Rx:
' {$STAMP BS2}
' {$PBASIC 2.5}


synch CON "A" 'This tells the receiver what to expect'
BAUD CON 16780
code VAR Word
DIRH=%11111111

Start:
SERIN 0,BAUD,[WAIT(synch),code]
IF code=11013 THEN forward 'Depending on code values'
IF code=21013 THEN backward
IF code=31013 THEN right
IF code=41013 THEN left
GOTO Start

forward:
PULSOUT 12,850
PULSOUT 13,650
PAUSE 20
RETURN

backward:
PULSOUT 12,650
PULSOUT 13,850
PAUSE 20
RETURN

right:
PULSOUT 12,850
PULSOUT 13,850
PAUSE 20
RETURN

left:
PULSOUT 12,650
PULSOUT 13,650
PAUSE 20
RETURN

The programs shows success tokenize
but the boebot is not show any action, I test the boebot movement and the pins placement but everything is OK
anyone can help me
thanks
 
Last edited:
You can't normally just send plain RS232 over a radio link, unless you're using modules with in-built encoding/decoding.
 
the transmitter is connected to homework board
receiver is on boe bot

USB cable is between PC and homework board (TX)
to see my projct connections:
**broken link removed**
**broken link removed**
**broken link removed**
 
' {$STAMP BS2}
' {$PBASIC 2.5}

TX PIN 0 ' transmitter

synch CON "A"
Baud CON 16780 ' Baud set at 9600

code VAR Word

dirChar VAR Word ' Stores directional character



DO

DEBUGIN dirChar
IF (dirChar = "8") OR (dirChar = "w") THEN
code = 11013


ELSEIF (dirChar = "2") OR (dirChar = "x") THEN
code = 21013

ELSEIF (dirChar = "4") OR (dirChar = "a") THEN
code = 31013

ELSEIF (dirChar = "6") OR (dirChar = "d") THEN
code = 41013

ENDIF


SEROUT 0,baud,[(synch),code] 'This sends the junk, followed by the synch'
PAUSE 10

DEBUG ? code
PAUSE 50
LOOP
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…