   Serial.println("SEARCHING");
   // Set the state, so the action can be handeled by the state machine.
   action_state = A_PINGSEARCH;
+}
+
+/**
+ * Look for somewhare to go.
+ */
+void actionWhiskerSearchLeft()
+{
+  Serial.println("WHISKERSEARCH LEFT");
+  // Set the state, so the action can be handeled by the state machine.
+  action_state = A_WHISKERSEARCH_LEFT;
+}
+
+/**
+ * Look for somewhare to go.
+ */
+void actionWhiskerSearchRight()
+{
+  Serial.println("WHISKERSEARCH RIGHT");
+  // Set the state, so the action can be handeled by the state machine.
+  action_state = A_WHISKERSEARCH_RIGHT;
 }
 
 void actionTimeoutStart(int duration)

    
      break;
      
    case A_PINGSEARCH:
      switch (motion_state) {
        case M_STOP:
           // reverse for 1 second
           actionTimeoutStart(1000);
           motionRev(); 
           Serial.println("SEARCH REVERSE");    
          break;
          
        case M_REV:
          if (action_done) {
            Serial.println("SEARCH LEFT");
            // Start pinging
            pingStart();
          
            actionTimeoutStart(500); //@todo not fake the search!
            motionRotateLeft(); 
          }
          break;
          
        case M_ROTATE_LEFT:
          if (action_done) {
            Serial.println("SEARCH RIGHT");
            actionTimeoutStart(2000); //@todo not fake the search!
            motionRotateRight(); 
          }
          break;

  
  // If the reading of the thumbstick is not the same as when calibrated,
  // we've hit something.
  if (action_state == A_PINGSEARCH || action_state == A_WHISKERSEARCH_LEFT || action_state == A_WHISKERSEARCH_RIGHT) {
    
    // Doing a search already, so don't interfere with a whiskers bump. 
    
  } else if (val > whiskers_horiz_default + whiskers_threshold) {
    Serial.println(whiskers_horiz_default);
    Serial.println("BUMP LEFT!");
    // Don't hit the obstacle.
    motionStop();
    soundDamage();
      
    actionWhiskerSearchLeft();
  
  } else if (val < whiskers_horiz_default - whiskers_threshold) {
    Serial.println(whiskers_horiz_default);
    Serial.println("BUMP RIGHT!");
    // Don't hit the obstacle.
    motionStop();
    soundDamage();
      
    actionWhiskerSearchRight();
  }

}

/********************************************************************************
