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
  • Avoid Ring’s Edge with QTI Sensors

Avoid Ring’s Edge with QTI Sensors

Test Front QTI Binary Values with Terminal

This second test will verify that your SumoBot robot’s QTIs return the correct 1/0 measurements used in competition programs for detecting black/white surfaces.  Instead of writing this program, you will download a pre-written example program, and then open it with BlocklyProp Solo.

Program

  • Use the animation below as a guide to downloading the QTIs Test Front BW Detect.svg test code and opening it with BlocklyProp Solo.  

QTIs Front Test BW Detect.svg

 

  • Click the Load & Run (Save code to EEPROM)  button  to load the program into your SumoBot.

Tests

Instead of the 230 magic number, this test will simply verify that each QTI measures 0 when over the white border or 1 over the black surface.

  • While the SumoBot is still connected to your computer with USB, set the SumoBot on the sumo ring near the edge.
  • Monitor the terminal as you place the SumoBot’s QTIs over the black and white surfaces.
  • Verify that the measurement for each QTI is 0 when you place it over the white edge of the sumo ring and 1 when it’s over the black surface.
  • Verify this for both left and right QTIs using the animation as a guide.

How It Works

The run function “QTIs Front” block makes the program complete the blocks in the QTIs Front function container before continuing on to the Terminal clear screen block.  

The QTIs Front function block sets two binary digits in a variable named qtis with 1 indicating a black surface and 0 indicating white.  The left of the two binary digits indicates the 1/0 black/white state of the left QTI, and the right indicates the state of the right QTI.  

Examples:

  • 00 – both QTIs over white surface
  • 01 – left QTI over white, right QTI over black
  • 10 – left QTI over black, right QTI over white
  • 11 – both QTIs over black

The QTIs Front function compares the QTI measurements to that 230 threshold.  If the measurement is below 230, the function sets a digit in the qtis variable to 0.  If it’s above 230, it sets that digit to 1.

 


Printer-friendly version
Test QTI Measurement Values with Terminal
Prev
Test Front QTI Binary Values with LEDs
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress