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

How Whisker Switches Work

The whiskers are connected to ground (GND) because the plated holes at the outer edge of the board are all connected to GND. The metal standoffs and screws are touching the GND so they too are part of GND. The standoffs and screws provide the electrical GND connection to each whisker.

Since each whisker is connected to Propeller I/O pins P7 and P9, the cyber:bot can be programmed to detect which voltage is applied to each circuit, 3.3 V or 0 V. Your script can detect the pin’s state, HIGH or LOW, with the read_digital function.

  • Look at the image below.

On the left, the circuit applies 3.3 V to P7 when the whisker is not pressed, so bot(7).read_digital returns a value of 1 (HIGH). On the right, the circuit applies 0 V to the pin when the whisker is pressed, so bot(7).read_digital returns a value of 0 (LOW). 

Most importantly, your script can store the return values in variables, such as whisker_left and whisker_right, and then use them to trigger actions or make decisions. The next example script will demonstrate how to accomplish this.

Switch Lingo — Each whisker is both the mechanical extension and the ground electrical connection of a normally open (off until pressed) momentary (on only while pressed) single-pole (one set of electrical contact points), single-throw (only one position conducts) switch, SPST for short.

There are many other types of switches in contrast to this momentary single-pole, single-throw, or SPST. For example there are also double-pole, single-throw (DPST); double-pole, double-throw (DPDT); and single-pole, double-throw (SPDT). The SPST style used for our whiskers in the most simple style to construct.


Printer-friendly version
Build the Whisker Circuits
Prev
Testing the Whiskers
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress