 void ping_measure()
 {
   unsigned int cm = sonar.ping_cm(); // Send a ping, get ping distance in cm.
-  
+  //unsigned int cm = 0;
   if (action_state == A_PINGSEARCH) {
     
     // looking for a new way to go.


#include <util/delay.h>

#include <NewPing.h> // From https://code.google.com/p/arduino-new-ping/
#include "NewTone.h" // Adapted from https://code.google.com/p/arduino-new-tone/

// The timer library lets us do things when we want them to happen
// without stopping everything for a delay.
#include "SimpleTimer.h"
#include <Servo.h>
//#include "ServoTimer2.h"

#include "Sound.h"

#define MOTOR_SPEED_MIN_A 200
#define MOTOR_SPEED_MAX_A 230 // This motor is slower on my setup.

void setup() {
  Serial.begin(9600); // Open serial monitor at 9600 baud to see debugging messages.
  
  irrecv.enableIRIn();
  /* Initialise the variable containing the last code received */
  LastCode = 0;
  
  pinMode(3, INPUT); // Re-wired from the shield's default
  pinMode(11, INPUT); // Re-wired from the shield's default
  
  
  // Setup Channel A
  pinMode(motorA_direction, OUTPUT); // Initiates motor pin for channel A
