27404 Parallax Inc, 27404 Datasheet - Page 170

COMPETITION RING FOR SUMOBOT

27404

Manufacturer Part Number
27404
Description
COMPETITION RING FOR SUMOBOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 27404

Accessory Type
Hobby and Education
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
SumoBot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Example Program: FrontAndSideIrNavigation.bs2
The beauty in terminating the rotate loop as soon as one of the front IR detectors sees the
object is that one of the other code blocks will then take over to get the SumoBot to face
its opponent. Let's see how it performs:
' -----[ Title ]--------------------------------------------------------------
' Applied Robotics with the SumoBot - FrontAndSideIrNavigation.bs2
' This is FrontIrNavigation.bs2 with peripheral IR object detection added.
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ I/O Definitions ]---------------------------------------------------
ServoLeft
ServoRight
IrLedLS
IrSenseLS
Save FrontIrNavigiation.bs2 as FrontAndSideIrNavigation.bs2
Insert the peripheral vision
before the
Use the printed example program to check your work.
Run the program.
Press and hold the Reset button as you take the SumoBot to the practice ring.
Make sure there all objects are well away from the SumoBot's front and side. If
there are objects near the ring, consider using an
makes the SumoBot nearsighted.
Set the SumoBot on the practice ring so that you are behind it. Otherwise, it will
see you and react immediately. Make sure that there are no other objects within
a couple meters of the ring.
Let go of the Reset button. The SumoBot should stay still because it doesn't see
anything.
Place your hand in view of its right IR object detector. The SumoBot should
immediately turn to face your hand and then lunge forward.
Press and hold the Reset button, and again place the SumoBot so that it can't see
you.
Place your hand in view of its left IR object detector and verify that it rounds on
an object to its left as well.
PIN
PIN
PIN
PIN
ELSE
keyword in the Main Routine.
13
12
2
1
ELSEIF...THEN...
' Target = BASIC Stamp 2
' Language = PBASIC 2.5
' Left servo connected to P13
' Right servo connected to P12
' Left IR LED connected to P2
' Left IR detector to P1
code blocks shown above just
IrFreq CON
directive that

Related parts for 27404