# HELP! Teacher in need of some programming advice for Parallax BOE-Bots!

Discussion in 'Robotics & Mechatronics' started by Don Murphy, Nov 30, 2016.

1. ### Don MurphyNew Member

Joined:
Nov 29, 2016
Messages:
1
Likes:
0
Hello,

I am a Technology teacher now assigned to teach a robotics course using Parallax Boe-bots! The problem is I have never worked with these before have no idea where to begin.

I have figured out how to make the boe-bot travel autonomously forward 10 feet, stop and turn on LED's for 10 seconds, but I want to have the robot turn 180 degrees and return.

Could someone help me out with a simple program to accomplish this?

2. ### Dr_DoggyWell-Known Member

Joined:
Aug 11, 2007
Messages:
1,715
Likes:
37
HI!
whats your code like?
a quick look at the user guide describes how to send data to servo:
https://www.parallax.com/sites/default/files/downloads/28125-Robotics-With-The-Boe-Bot-v3.0.pdf

A faster/longer turn just means increasing/decreasing the values or pulse count:.

Code (text):

Forward: ' Forward subroutine.
FOR pulseCount = 1 TO 64 ' Send 64 forward pulses.
PULSOUT 13, 850 ' 1.7 ms pulse to left servo.
PULSOUT 12, 650 ' 1.3 ms pulse to right servo.
PAUSE 20 ' Pause for 20 ms.
NEXT
RETURN ' Return to Main Routine loop.
' -----[ Subroutine - Backward ]----------------------------------------------
Backward: ' Backward subroutine.
FOR pulseCount = 1 TO 64 ' Send 64 backward pulses.
PULSOUT 13, 650 ' 1.3 ms pulse to left servo.
PULSOUT 12, 850 ' 1.7 ms pulse to right servo.
PAUSE 20 ' Pause for 20 ms.
NEXT
RETURN ' Return to Main Routine loop.
' -----[ Subroutine - Left_Turn ]---------------------------------------------
Left_Turn: ' Left turn subroutine.
FOR pulseCount = 1 TO 24 ' Send 24 left rotate pulses.
PULSOUT 13, 650 ' 1.3 ms pulse to left servo.
PULSOUT 12, 650 ' 1.3 ms pulse to right servo.
PAUSE 20 ' Pause for 20 ms.
NEXT
RETURN ' Return to Main Routine loop.
' -----[ Subroutine – Right_Turn ]--------------------------------------------
Right_Turn: ' right turn subroutine.
FOR pulseCount = 1 TO 24 ' Send 24 right rotate pulses.
PULSOUT 13, 850 ' 1.7 ms pulse to left servo.
PULSOUT 12, 850 ' 1.7 ms pulse to right servo.
PAUSE 20 ' Pause for 20 ms.
NEXT
RETURN