Shop OBEX P1 Docs P2 Docs Learn Events
Just wondering about controls... — Parallax Forums

Just wondering about controls...

msg009msg009 Posts: 2
edited 2010-08-19 16:26 in BASIC Stamp
Is there any way to control the Boe Bot without the Bluetooth connector? Like controlling it with the arrow keys?

Here is my movement program (without ramping/ just basic movements):
' {$STAMP BS2}
' {$PBASIC 2.5}

counter VAR Word

GOSUB forward
GOSUB backward
GOSUB left
GOSUB right

END

forward:
FOR counter = 1 TO 100
PULSOUT 12, 850
PULSOUT 13, 650
PULSOUT 14, 850
PULSOUT 15, 650
PAUSE 20
NEXT

backward:
FOR counter = 1 TO 100
PULSOUT 12, 650
PULSOUT 13, 850
PULSOUT 14, 650
PULSOUT 15, 850
PAUSE 20
NEXT

left:
FOR counter = 1 TO 50
PULSOUT 12, 750
PULSOUT 13, 650
PULSOUT 14, 750
PULSOUT 15, 650
PAUSE 20
NEXT

right:
FOR counter = 1 TO 50
PULSOUT 12, 850
PULSOUT 13, 750
PULSOUT 14, 850
PULSOUT 15, 750
PAUSE 20
NEXT
My bot has four wheels by the way.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-19 16:26
    Just how do you want to control your BoeBot? You mention not wanting to use a Bluetooth connector and you mention wanting to use arrow keys. What do you mean?

    Do you want to use the programming connection between the BoeBot and your PC? It's not at all clear.

    In the example you posted, you call "forward", "backward", "left", and "right" as subroutines, but you don't have a RETURN statement at the end of each. You'll need that.
Sign In or Register to comment.