Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • cyber:bot Sumo Contests

cyber:bot Sumo Contests

Test IR Circuits and Charge at the Opponent

In this activity, you will build and test IR object detection circuits and then write a script to make the cyber:bot charge an opponent based in object detection.

Example Script: cyberbot_sumo_ir_test

  • Open cyberbot_sumo_avoid_edge with the micro:bit Python Editor.
  • Change the project name to cyberbot_sumo_ir_test.
  • Enter the script below into the micro:bit Python editor, then click Save.

Tests

  • Connect the cyber:bot to the computer with the USB cable.
  • Click the Send to micro:bit button to load the script into the micro:bit.
  • (The cyber:bot can be left connected OR disconnected from USB at this point.)
  • Set the PWR switch to 1.
  • Set the cyber:bot on the sumo ring with both infrared detectors pointing away from any nearby objects.
  • Verify that both IR indicator lights are on.
  • Place an object in front of the right IR detector and verify that the right IR indicator light turns off.
  • Place an object in front of the left IR detector, and verify that the left IR indicator light turns off.
  • Place an object in front of the left IR detector, and verify that the left IR indicator light turns off.
  • Place an object in front of both IR detectors, and verify that the both indicator lights turns off.

Troubleshooting

If the lights do not behave as expected, double check all electrical connections and each line of code.

Test for Infrared Interference

Follow the instructions in the Check for IR Interference page.

Sensitivity (Distance) Adjustments

This will be important

Follow the instructions in the Series Resistance and Range page.  Return here when you are done.

Try Other Infrared Navigation Examples

Here are some general infrared navigation examples:

Navigate and Avoid Obstacles

Faster IR Navigation

Drop-off Detector

Simulate a Drop-off with Poster Board

Avoid Drop-offs

Return here when you are done.

Adjust IR LEDs to Point Straight Ahead

For best results against a competitor, adjust the IR LEDs and receivers so that they point straight ahead.

Try This: Infrared Charger Mode

  • If it’s not already open, click the Open button and reopen cyberbot_sumo_ir_test
  • Set the project name to to cyberbot_sumo_ir_charger.
  • Enter the script below into the micro:bit Python editor, then click Save.
  • Disconnect the cyber:bot from USB, set it on the floor, and set PWR to 2.
  • Verify that the cyber:bot chases your hand:
    • If neither or both IR detectors see an object, the cyber:bot should roll straight forward.
    • If one IR detector sees an object, it should turn toward that detector.


Printer-friendly version
Add the IR Circuits
Prev
Basic Autonomous Sumo
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2025 Parallax Learn • Built with GeneratePress