Skip to content
Parallax Learn (Stage)

Parallax Learn (Stage)

This is the staging site. Please see https://learn.parallax.com for the official site.

  • 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 Tutorial Series
          • Cybersecurity: Radio Data tutorialCybersecurity Tutorial Series
          • cyber:bot Tutorial Series
          • Boe-Bot Tutorial SeriesBoe-Bot Tutorial Series
          • Arduino Shield-Bot Tutorial Series
          • ActivityBot with C TutorialsActivityBot with C Tutorials
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot with BlocklyProp Tutorial Series
          • Scribbler 3 Tutorial SeriesScribbler 3 Tutorial Series
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education Tutorial Series
          • Propeller C-Language BasicsPropeller C Basics and Projects
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit C Tutorial Series
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit BlocklyProp Tutorials
          • Badge WX Tutorial SeriesBadge WX Tutorial Series
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics and Projects
          • 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
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • Robotics with the Board of Education Shield for Arduino

Robotics with the Board of Education Shield for Arduino

Chapter 1 Solutions

Question Solutions

  1. The Arduino module. 
  2. Binary numbers, that is, 0’s and 1’s.  We also saw examples of how the numbers that represent characters are ASCII codes, like 109 = ‘m’.
  3. The setup function’s statements get executed once when the sketch starts.  After finishing the setup function, the sketch advances to the loop function.  Its code block gets repeated indefinitely.
  4. The variable’s name is used for assignment and comparison in the sketch.  The variable’s type defines the kind and range of values it can store. 
  5. Global variables can be accessed and modified by any function in the sketch.  Local variables can only be accessed and modified within the block where they are declared. 
  6. The arithmetic operators are + add, – subtract, * multiply, / divide, and % modulus. 
  7. It will be treated as a float type because it has a decimal point.
  8. Initialization, condition, increment.
  9. A block comment starts with /* and ends with */, and allows you to write comments that span multiple lines.  A line comment starts with // and makes whatever is to its right on that particular line a comment.

Exercise Solutions

  1. Solution:
Serial.print("the value of i = ");
Serial.println(i);
  1. Solution:
long bigVal = 80000000;
  1. Solution:
if(myVar % 2 == 0)
{
  Serial.println("The variable is even. ");
}
else
{
  Serial.println("The variable is odd. ");
}
  1. Solution:
for(int i = 21; i <= 39; i+=3)
{
  Serial.print("i = ");
  Serial.println(i);
}

  1. Solution:
char c = "a";
Serial.print("Character = ");
Serial.print(c);
Serial.print("   ASCII value = ");
Serial.println(c, DEC);

  1. Solution:
for(char c = 'A'; c <='Z'; c++){}

Project Solutions

  1. This sketch is a modified version of CountToTen that utilizes the solution to Exercise 5 for displaying ASCII characters.
// Robotics with the BOE Shield - Chapter 1, Project 1

void setup()
{
  Serial.begin(9600);
 
  for(char c = ' '; c <= '~'; c++)
  {
    Serial.print("Character = ");
    Serial.print(c);
    Serial.print("   ASCII value = ");
    Serial.println(c, DEC);
  }
  Serial.println("All done!");
}

void loop()
{
  // Empty, no repeating code.
}

  1. This sketch is a modified version of SimpleDecisions that uses a variation of the solution from Exercise 3 to display whether the variable is odd or even.
// Robotics with the BOE Shield - Chapter 1, Project 2

void setup()
{
  Serial.begin(9600);

  int a = 20;

  if(a % 2 == 0)
  {
    Serial.print("a is even");
  }
  else
  {
    Serial.print("a is odd");
  }
}

void loop()
{
  // Empty, no repeating code.
}


Printer-friendly version
Chapter 1 Challenges
Prev
Chapter 2. Shield, Lights, Servo Motors
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn (Stage) • Built with GeneratePress