Datasheet

Chapter 1 Your Shield-Bot’s Brain
40Robotics with the BOE Shield-Bot
3. Solution:
if(myVar % 2 == 0)
{
Serial.println("The variable is even. ");
}
else
{
Serial.println("The variable is odd. ");
}
4. Solution:
for(int i = 21; i <= 39; i+=3)
{
Serial.print("i = ");
Serial.println(i);
}
5. Solution:
char c = "a";
Serial.print("Character = ");
Serial.print(c);
Serial.print(" ASCII value = ");
Serial.println(c, DEC);
6. 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);