Programming USR sensor integration issues. Need an answer ASAP

I’m powering a hovercraft and for some reason I keep getting the error saying
‘microsecondtoinches’ was not declared in this scope and ‘microsecondstocentimeters’ was not declared in this scope. I’m not great at programming so don’t tear me apart. Using the same code integrated with an LED there was no declaration for these two that was any different than what I’m using now. All I need to know is how to fix this without deleting these elements out of my code. Thanks in advance.

const int levFan = 3; //digital pin for lev fan
const int propR=5; //digital pin for right prop
const int propL=6; //digital pin for left prop
const int pingPin = 7;
const int inPin = 8;   // choose the input pin (for a pushbutton)
int val = 0; 
int ping;// variable for reading the pin status




#include <Servo.h> 
 
Servo myservo;  // create servo object to control a servo 
Servo bottom;                // a maximum of eight servo objects can be created 
 
int pos = 0;    // variable to store the servo position 


void setup() {
pinMode(propR, OUTPUT);
pinMode(propL, OUTPUT);
pinMode(levFan, OUTPUT);
pinMode(inPin, INPUT);   

pinMode(pingPin, INPUT);
Serial.begin(9600);
myservo.attach(12);
bottom.attach(2);
delay(25); 

}

void loop(){
  
  long duration, inches, cm;

    pinMode(pingPin,OUTPUT);
    digitalWrite(pingPin,LOW);
    delayMicroseconds(2);
    digitalWrite(pingPin,HIGH);
    delayMicroseconds(5);
    digitalWrite(pingPin,LOW);

    pinMode(pingPin,INPUT);
    duration =pulseIn(pingPin,HIGH);

    inches = microsecondsToInches(duration);
    cm = microsecondsToCentimeters(duration);

    Serial.print(inches);
    Serial.print("in, ");
    Serial.print(cm);
    Serial.print("cm");
    Serial.println();
    delay(100);
    
  val = digitalRead(inPin);  // read input value
  if (val == HIGH) 
  { 
    analogWrite(propR, 255);
  analogWrite(propL, 255);

digitalWrite(levFan, HIGH); //have the lev fan running at full power(can change to analog write to adjust output)
  }

//put actual code in



   else{
     myservo.attach(12);
bottom.attach(2);
  analogWrite(propR, 1);
  analogWrite(propL, 1);
  digitalWrite(levFan, LOW );
  
  
  if (inches <= 4) {
           bottom.write(90);
delay(5000);
        }
        else {
            myservo.write(10);
delay(100);
        }

}

long microsecondsToInches(long microseconds)
{
    return microseconds /74/2;
}

long microsecondsToCentimeters(long microseconds)
{
    return microseconds /29/2;
}
   
    


  
  
  




}

hovercraft ? Do you mean DIY drone as in Quadcopter ?

No, I mean a hovercraft we are making for our Engineering project. The goal is to have it follow a line into an arena and successfully sense for the “shallow box” in a four quadrant pedestal and drop a ping pong ball into that box.
This is our hovercraft, http://tinypic.com/view.php?pic=5kpz61&s=8#.U1R3kPldVAI

JeremyTerp, you should make the layout of the code better. Every indent and every bracket should be in the right place. I think there is a mismatch with the curly brackets.

Yes I found the error and it was with one of the curly brackets. At this point I have just about everything working, except for some reason when the servo is completing its sweep of the boxes four quadrants the USR is not reading any new values until the code ends. Is there a way to shut off the servo after turning to the desired quadrant, having the USR scan and then continue onward? Currently my code looks like this

const int levFan = 3; //digital pin for lev fan
const int propR=5; //digital pin for right prop
const int propL=6; //digital pin for left prop
const int pingPin = 7;
const int inPin = 8;   // choose the input pin (for a pushbutton)
int val = 0; 
int ping;// variable for reading the pin status




#include <Servo.h> 
 
Servo myservo;  // create servo object to control a servo 
Servo bottom;                // a maximum of eight servo objects can be created 
 
int pos = 0;    // variable to store the servo position 


void setup() {
pinMode(propR, OUTPUT);
pinMode(propL, OUTPUT);
pinMode(levFan, OUTPUT);
pinMode(inPin, INPUT);   

pinMode(pingPin, INPUT);
Serial.begin(9600);
myservo.attach(12);
bottom.attach(2);
delay(25); 

}

void loop(){
  
  long duration, inches, cm;

    pinMode(pingPin,OUTPUT);
    digitalWrite(pingPin,LOW);
    delayMicroseconds(2);
    digitalWrite(pingPin,HIGH);
    delayMicroseconds(5);
    digitalWrite(pingPin,LOW);

    pinMode(pingPin,INPUT);
    duration =pulseIn(pingPin,HIGH);

    inches = microsecondsToInches(duration);
    cm = microsecondsToCentimeters(duration);

    Serial.print(inches);
    Serial.print("in, ");
    Serial.print(cm);
    Serial.print("cm");
    Serial.println();
    delay(100);
    
  val = digitalRead(inPin);  // read input value
  if (val == HIGH) 
  { 
    analogWrite(propR, 255);
  analogWrite(propL, 255);

digitalWrite(levFan, HIGH); //have the lev fan running at full power(can change to analog write to adjust output)
 myservo.write(10);
  }

//put actual code in




   else{
     myservo.write(10);
     delay(1000);
  analogWrite(propR, 1);
  analogWrite(propL, 1);
  digitalWrite(levFan, LOW );
  
  
  if (inches <= 2) {
           bottom.write(10);
           delay(1000);
        }
        else {
           myservo.write(15);
           delay(100);
           myservo.write(20);
           delay(100);
           myservo.write(25);
           delay(100);
           myservo.write(30);
           delay(100);
          myservo.write(35);
          delay(100);
          myservo.write(40);
          delay(100);
          myservo.write(45);
          delay(10000);
            
                  if (inches <= 2) {
                    bottom.write(10);
                    delay(1000);
              
                  }
                    else {
                      myservo.write(50);
                       delay(100);
                       myservo.write(55);
                       delay(100);
                         myservo.write(60);
                       delay(100);
                       myservo.write(65);
                       delay(100);
                        myservo.write(70);
                        delay(100);
                        myservo.write(75);
                        delay(100);
                        myservo.write(80);
                      delay(100);
                       myservo.write(85);
                        delay(100);
                        myservo.write(90);
                        delay(100);
                        myservo.write(95);
                      delay(10000);
                
                
                                          if(inches <=2) {
                                            bottom.write(10);
                                            delay(1000);
                                          }
                                          else 
                                          {
                                            myservo.write(100);
                                             delay(100);
                                             myservo.write(105);
                                             delay(100);
                                               myservo.write(110);
                                             delay(100);
                                             myservo.write(115);
                                             delay(100);
                                              myservo.write(120);
                                              delay(100);
                                              myservo.write(125);
                                              delay(100);
                                              myservo.write(130);
                                            delay(100);
                                             myservo.write(135);
                                              delay(100);
                                              myservo.write(140);
                                              delay(100);
                                              myservo.write(145);
                                            delay(10000);
                    }
                    }

}
   }
}
long microsecondsToInches(long microseconds)
{
    return microseconds /74/2;
}

long microsecondsToCentimeters(long microseconds)
{
    return microseconds /29/2;
}

Still trying to solve this, any input?

It’s hard to follow with no comments.

void loop(){

The only argument that holds any water for placing the { on the same line as the statement is that it reduces the number of lines needed to display the function. Following that with a blank line is then just plain stupid.

Use Tools + Auto Format to format your code before you post it again.

Servo bottom;                // a maximum of eight servo objects can be created

How does this comment contribute anything useful?

//put actual code in

But not here.

           myservo.write(15);
           delay(100);
           myservo.write(20);
           delay(100);
           myservo.write(25);
           delay(100);
           myservo.write(30);
           delay(100);
          myservo.write(35);
          delay(100);
          myservo.write(40);
          delay(100);
          myservo.write(45);
          delay(10000);

What is the point of waving this servo all over the place? What the hell does myservo mean? bottom isn't a great name for a servo, but it beats the hell out of myservo.