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
  • QTI Line Follower for cyber:bot

QTI Line Follower for cyber:bot

Block Program for Line Following

Basic Line Following with cyber:bot

How many possible combinations of QTI sensor states exist from pattern? The values could range from 0b0000 (0) to 0b1111 (8+4+2+1=15) for a total of 16 different number combinations!

Is it likely that pattern would be 0b1001 where the two outside QTI sensors are seeing black? Not likely since they’re 1-½” apart and electrical tape is less than ¾” wide. Rather than check for every possible 16 cases, choose the ones which are most likely. This saves memory and creates a faster-running program. The example program has eight possibilities shown and described in the following 8 images. 

0b1000, Sharp left turn

0b1100, Medium left turn

0b0100, Gentle left turn

0b0110, Straight ahead full speed

0b0010, Gentle right turn

0b0011, Medium right turn

0b0001, Sharp right turn

0b0000, Backup, turn, rotate, make a sound – or do the same command previously executed?

The cyber:bot Forward and Backward tutorial showed how the right motor must turn the opposite direction for the robot to go forward, using negative values. For example:

Note that the example QTI_Follow_Line code uses all positive values. How is that possible? At the end of the program, the wR values are made opposite, allowing the use of all positive numbers as arguments.

This makes it a little bit easier to come up with drive speed values in the example program. The values work well with a gentle, curvy line formed with electrical tape. The combinations of motor speeds you use will vary based on the line you create. 

Project: QTI_Follow_Line

  • If it’s not still open, use the micro:bit Makecode Editor to Open QTI_Display_Detections.
  • Set the name to QTI_Follow_Line, update the project so that it matches the one below.
  • Click Download. 
  • Set the PWR switch to 2, and test the cyber:bot on your track.
  • Depending on the difficulty of the track, you might need to slow down or speed up some of the project’s maneuvers. There is also plenty of room for customizations to improve the cyber:bot robot’s QTI roaming performance on various tracks.
  • Remember to set the PWR switch to 0 when you are not running the cyber:bot. If you are done for the day, also unplug the battery pack barrel plug from the cyber:bot board’s barrel jack.

High-speed Line Following with cyber:bot

If you are competing in a line following contest, you can speed up your cyber:bot two different ways.

  1. First, consider moving the power jumper from Vdd to Vin.
  2. Next, you could upgrade your cyber:bot with the Parallax Feedback 360° High Speed Servos.

Printer-friendly version
Testing Your cyber:bot QTIs
Prev

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress