Datasheet
Chapter 3: EEPROM Tricks and Program Tips · Page 93
√ If zero "yes" readings appear, move the SumoBot 5 cm closer to the wall. If
several "yes" readings appear, move the SumoBot 5 cm farther from the wall.
√ Press and release the Reset button to refresh the Debug Terminal.
√ Repeat until you find the distance threshold between no object detections and a
few object detections at the most sensitive frequencies.
√ Move the SumoBot closer in 5 cm increments, testing the frequency response
between each move.
√ Take notes and make an order of which frequencies can be used for closer and
farther objects.
√ Repeat this experiment with a SumoBot opponent across the ring.
√ Keep moving the SumoBot closer in 5 cm increments, and track which
frequencies detect it at which distances.
Selecting a frequency to use will depend on the location of the competition ring. If
onlookers stay more than 1 m away from the outside of the ring and IR detectors aren't
seeing the floor outside the ring, choose the most sensitive frequency. If onlookers are likely
to be only 0.5 m outside the ring, or the object detectors see the floor's reflection, choose a
compromise frequency that will be less likely to detect the floor or onlookers, but still pretty
likely to detect its opponent.
You may also want to consider adding extra distance sensors, such as the Parallax Ping)))
Ultrasonic Sensor. You can use its distance measurement capabilities to help your
SumoBot decide whether it's viewing an onlooker or its opponent.
' -----[ Title ]--------------------------------------------------------------
' Applied Robotics with the SumoBot - TestFrequencyResponse.bs2
' This program can be used with objects at varying distances to determine
' which frequencies make the SumoBot more nearsighted or farsighted.
' {$STAMP BS2} ' Target = BASIC Stamp 2
' {$PBASIC 2.5} ' Language = PBASIC 2.5
' -----[ I/O Definitions ]---------------------------------------------------
IrLedLF PIN 4 ' Left IR LED connected to P4
IrSenseLF PIN 11 ' Left IR detector to P11
IrLedRF PIN 15 ' Right IR LED connected to P15
IrSenseRF PIN 14 ' Right IR detector to P14
' -----[ Variables ]----------------------------------------------------------
irLF VAR Bit ' State of Left Front IR
irRF VAR Bit ' State of Right Front IR
frequency VAR Word ' Stores Frequencies