Datasheet
Chapter 5 • Tactile Navigation with Whiskers
168 • Robotics with the BOE Shield-Bot
Chapter 5 Summary
This chapter introduced the first sensor system for the BOE Shield-Bot, and allowed the
robot to roam around on its own and navigate by touch. The project built on skills acquired
in the last chapter, and employed a variety of new ones:
Electronics
• Building normally open, momentary, single-pole, single-throw, tactile switch
circuits
Programming
• Using the Arduino language’s pinMode and digitalRead functions to set a
digital I/O pin to input and then monitor the pin’s input state
• Declaring and initializing global variables
• Nesting function calls
• Using
if…else statements to direct program flow based on sensor input states
• Using three levels of nested
if statements
Robotics Skills
• Autonomous robot navigation based on sensor inputs
• Using a simple example of artificial intelligence so the autonomously roaming
BOE Shield-Bot can tell if it’s stuck in a corner, and exit
Engineering Skills
• Subsystem testing again—build that good habit!
• Using an indicator LED to visibly display the state of a system input
• Using an indicator LED to visibly display program flow
Chapter 5 Challenges
Questions
1. What kind of electrical connection is a whisker?
2. When a whisker is pressed, what voltage occurs at the I/O pin monitoring it?
What binary value will the
digitalRead function return? If digital pin 8 is used
to monitor the whisker circuit, what value does
digitalRead return when a
whisker is pressed, and what value does it return when a whisker is not pressed?
3. If
digitalRead(7)== 1, what does that mean? What does it mean
if
digitalRead(7)== 0? How about digitalRead(5)== 1
and
digitalRead(5)== 0?