Shop OBEX P1 Docs P2 Docs Learn Events
Wireless RC Boe-Bot — Parallax Forums

Wireless RC Boe-Bot

WarumaWaruma Posts: 21
edited 2010-09-10 23:27 in Accessories
Hello, I've been trying to get my Boe-Bot to become remote controlled, but I'm having problems with the code. I think I've done everything correctly, but I just can't get it to work. Can someone please help with my code snippets? I don't know if it's timing issues, or what but I can't get it...

Send Code:

'
[ Constants ]

SendOrReceive PIN 5
InfoPin PIN 6
'ReceivePin PIN 6
'
[ Variables ]

pulseLeft VAR Word ' Variable declarations
pulseRight VAR Word
duration VAR Word

Rx VAR Bit
Tx VAR Bit
Setting VAR Bit

Direction VAR Byte


'
[ Initialization ]

'FREQOUT 4, 125, 3000 ' Signal program start/reset.

'
[ Main Routine ]


Tx = 1
Rx = 0
Setting = Tx


'
[ Main Routine ]
IF (Setting = 1) THEN
DEBUG "Program Running!", CR
HIGH SendOrReceive

DO

Direction = "w"
'LOW TransmitPin
PULSOUT InfoPin, 1200
SEROUT InfoPin, 16468, [ "!", Direction ]
PAUSE 10
DEBUG ? Direction

LOOP
ENDIF

Receive Code:

'
[ Constants ]

SendOrReceive PIN 5
InfoPin PIN 6
'ReceivePin PIN 6
'
[ Variables ]

pulseLeft VAR Word ' Variable declarations
pulseRight VAR Word
duration VAR Word

Rx VAR Bit
Tx VAR Bit
Setting VAR Bit

Direction VAR Byte


'
[ Initialization ]

'FREQOUT 4, 125, 3000 ' Signal program start/reset.

'
[ Main Routine ]


Tx = 1
Rx = 0
Setting = Rx

'
[ Main Routine ]

IF (Setting = 0) THEN
LOW SendOrReceive
Direction = 0

DO
SERIN InfoPin, 16468, [WAIT("!"), Direction ]
PAUSE 10
' Direction = "w"

IF (Direction = "w") THEN
pulseRight = 650
pulseLeft = 850
ENDIF

DEBUG ASC ? Direction

'FOR duration = 0 TO 300
PULSOUT 13, pulseLeft
PULSOUT 12, pulseRight
PAUSE 20
'NEXT

LOOP
ENDIF
END

Comments

  • FranklinFranklin Posts: 4,747
    edited 2010-09-10 13:32
    Let's start by what you are getting between the two, what you expect, how you have it connected and what are you using to communicate.
  • WarumaWaruma Posts: 21
    edited 2010-09-10 23:27
    Franklin - halfway through my explanation of what I was trying to do and what pins were connected to what in my circuit - I found a miss wire. I fixed it and my code works as expected. I will continue to expand upon this code to make the robot travel in more directions than forward.

    Thanks for your help!
Sign In or Register to comment.