EasyManuals Logo

Parallax Boe-Bot User Manual

Parallax Boe-Bot
360 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #230 background imageLoading...
Page #230 background image
Page 216 · Robotics with the Boe-Bot
FREQOUT 4, 2000, 3000
' -----[ Main Routine ]-------------------------------------------------------
DO
GOSUB Test_Photoresistors
GOSUB Navigate
LOOP
' -----[ Subroutine - Test_Photoresistors ]-----------------------------------
Test_Photoresistors:
HIGH 6 ' Left RC time measurement.
PAUSE 3
RCTIME 6,1,timeLeft
HIGH 3 ' Right RC time measurement.
PAUSE 3
RCTIME 3,1,timeRight
RETURN
' -----[ Subroutine - Navigate ]----------------------------------------------
Navigate:
IF (timeLeft < LeftThreshold) AND (timeRight < RightThreshold) THEN
PULSOUT 13, 850 ' Both detect flashlight beam,
PULSOUT 12, 650 ' full speed forward.
ELSEIF (timeLeft < LeftThreshold) THEN ' Left detects flashlight beam,
PULSOUT 13, 700 ' pivot left.
PULSOUT 12, 700
ELSEIF (timeRight < RightThreshold) THEN ' Right detects flashlight beam,
PULSOUT 13, 800 ' pivot right.
PULSOUT 12, 800
ELSE
PULSOUT 13, 750 ' No flashlight beam, sit still.
PULSOUT 12, 750
ENDIF
PAUSE 20 ' Pause between pulses.
RETURN

Table of Contents

Other manuals for Parallax Boe-Bot

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Parallax Boe-Bot and is the answer not in the manual?

Parallax Boe-Bot Specifications

General IconGeneral
BrandParallax
ModelBoe-Bot
CategoryRobotics
LanguageEnglish