 void search() {
   while(!found) {
     // 0 is forward, 1 is backward
-    move(1, 128, rightDir); //right motor
-    move(2, 128, leftDir); //left motor
+    move(1, 200, rightDir); //right motor
+    move(2, 200, leftDir); //left motor
     calcDistance();
     //Serial.print("left: ");
     Serial.print(leftDistance);
     Serial.print(",");
     Serial.println(rightDistance);
-    delay(10);
+    //delay(10);
     if(lost) {
       if(diff>0){//turn right
         rightDir = 0;


int leftDir = 0;
int rightDir = 1;
//-----------------------------

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

//motor: 0 for B 1 for A
//speed: 0 is off, and 255 is full speed
//direction: 0 clockwise, 1 counter-clockwise
 digitalWrite(STBY, HIGH); //disable standby

 boolean inPin1 = LOW;
 boolean inPin2 = HIGH;

 if(direction == 1){
   inPin1 = HIGH;
   inPin2 = LOW;
 }

 if(motor == 1){
   digitalWrite(AIN1, inPin1);
   digitalWrite(AIN2, inPin2);
   analogWrite(PWMA, speed);
 }else{
   digitalWrite(BIN1, inPin1);
   digitalWrite(BIN2, inPin2);
   analogWrite(PWMB, speed);
 }
}

void stop(){
