Datasheet
Tactile Navigation with Whiskers • Chapter 5
Robotics with the BOE Shield-Bot • 175
void loop() // Main loop auto-repeats
{ // Nothing needs repeating
int wLeft = digitalRead(5);
int wRight = digitalRead(7);
if(wLeft == 0)
{
turn -= 10;
}
else if(wRight == 0)
{
turn += 10;
}
// Arc to the right
servoLeft.writeMicroseconds(1600); // Left wheel counterclockwise
servoRight.writeMicroseconds(1438 + turn); // Rt wheel clockwise slower
delay(50); // ...for 25.5 seconds
}