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 #247 background imageLoading...
Page #247 background image
Chapter 6: Light Sensitive Navigation with Photoresistors · Page 233
"FlashlightControlledBoeBot.bs2" and "RoamingTowardTheLight.bs2". A
sample solution is shown below.
' -----[ Title ]-------------------------------------------------------
' Robotics with the Boe-Bot - AvoidBlackSpots.bs2
' Boe-Bot avoids black pieces of paper.
' {$STAMP BS2} ' Stamp directive
' {$PBASIC 2.5} ' PBASIC directive.
' -----[ Constants ]---------------------------------------------------
LeftWhite CON 16
RightWhite CON 33
LeftBlack CON 26
RightBlack CON 45
LeftAvg CON LeftWhite + LeftBlack / 2
RightAvg CON RightWhite + RightBlack / 2
' -----[ Variables ]---------------------------------------------------
timeLeft VAR Word ' Left photoresistor
reading
timeRight VAR Word ' Right photoresistor
reading
' -----[ Initialization ]----------------------------------------------
FREQOUT 4, 2000, 3000
' -----[ Main Routine ]------------------------------------------------
DO
GOSUB Test_Photoresistors
GOSUB Navigate
LOOP
' -----[ Subroutines --------------------------------------------------
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
Navigate:

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