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