 
 void loop(){
   search();
-  follow();
 }
 
 void move(int motor, int speed, int direction){

void search() {
  while(!found) {
    // 0 is forward, 1 is backward
    move(1, 128, 1); //right motor
    move(2, 128, 0); //left motor
    calcDistance();
    Serial.println(leftDistance);
    Serial.println(rightDistance);
    delay(10);
    if((leftDistance <= maximumRange && leftDistance >= minimumRange) ||
       (rightDistance <= maximumRange && rightDistance >=minimumRange)) {
        found = true;
        Serial.println("FOUND");
      stop();  
      //uncomment for looped testing of search function  
      //delay(1000);
      //found = false;

int STBY = 10; //standby

//Motor A
int PWMA = 3; //Speed control
int AIN1 = 8; //Direction
int AIN2 = 9; //Direction

//Motor B
int PWMB = 5; //Speed control 
int BIN1 = 12; //Direction
int BIN2 = 11; //Direction

#define leftEcho 2  // left Echo Pin
#define leftTrig 4  // left Trigger Pin
