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
  • Touch Navigation for the cyber:bot

Touch Navigation for the cyber:bot

Testing the Whiskers

The next project tests the whiskers to make sure they are functioning properly, by using the micro:bit module’s LED matrix display. This gives a visual representation of the binary values (LED off = 1 and LED on = 0) returned by (Pin7) read digital and (Pin9) read digital. This way, you can press each whisker against its 3-pin header on the breadboard, and see if the Propeller I/O pin is sensing the electrical contact. 

When neither whisker is pressed against its 3-pin header, you can expect your micro:bit module’s display to have no LEDs light up. If you press only the right whisker, the display should have one LED on the right side light up. If you press only the left whisker, one LED on the left side will light up. Finally, if you press both whiskers simultaneously, an LED on both sides will light up.

 

 No Whiskers Touching: no lights on 

 

Left Whisker Touching: LED lights up on left side of the cyber:bot 

 

Right Whisker Touching: LED lights up on right side of the cyber:bot 

 

Both Whiskers Touching: LED lights up on both sides

 

Hardware Setup

  • Set the cyber:bot board’s power (PWR) switch to Position 0.
  • Make sure the battery holder is loaded with 5 AA batteries.
  • Make sure the battery holder’s barrel plug is firmly plugged into the cyber:bot board’s barrel jack. 
  • Connect your micro:bit module to your computer with a USB cable.

Software Setup

  • In a browser, go to makecode.microbit.org to open the micro:bit Makecode Editor.
  • Make sure the cyberbot extension is added to the Project Files.
    (See Add extensions to your micro:bit).

Example project: whiskers_detect_test

  • Set the name to whiskers_detect_test and enter the project below.
    (See Save & Edit Projects and Flash Projects with MakeCode Editor.)
  • Click Download.
    (See Flash Projects with MakeCode Editor.)
  • Set the cyber:bot board’s PWR switch to 1.

  • Look at the LEDs on the micro:bit module. With no whiskers pressed, all the LEDs should be off, indicating 3.3 V is applied to both digital inputs (7 and 9).
  • Press the right whisker into its three-pin header, you should notice an LED on the right side of the micro:bit module’s display turn on.
  • Release the right whisker and press the left whisker into its three-pin header, and an LED on the left side of the micro:bit module should be on.
  • Press both whiskers against both three-pin headers, both of those LEDs should be on.
  • If the whiskers passed all these tests, you’re ready to move on. If not, check your project and circuits for errors, and try the troubleshooting tips below.

Troubleshooting Tips

A lot of times, problems that occur when dealing with whiskers do not come from the blocks, but rather the physical connections of the whiskers. Try the following things to improve the physical connections of the whiskers.

  • If the whiskers rotate freely around the posts, try to tighten the screw that is holding in the whisker.
  • If the whisker is too far from the 3-pin header, rotate the whisker around the post so it’s closer to the 3-pin header.
  • If the whisker is always touching the 3-pin header, rotate the whisker around the post so that it moves away from the 3-pin header.
  • Be cautious as to not allow your resistor wires to come in contact with one another as this may mess up the whisker circuit.

These steps are important! 
Seriously, you’ve got to make sure your circuit and code pass these tests before continuing. The rest of the examples in this chapter rely on the whiskers working correctly. If you haven’t tested and corrected any errors, the rest of the examples won’t work right.


Printer-friendly version

Leave a Comment Cancel reply

How Whisker Switches Work
Prev
How the Whisker Test Code Works
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress