Why does it say "Servo" does not name a type #define pingTrig 6 
#define pingEcho 7 

#include 

Servo myservo;

void setup()
{
pinMode(pingTrig, OUTPUT);
pinMode(pingEcho, INPUT);
myservo.attach(9);
}

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

digitalWrite(pingTrig, LOW);
digitalWrite(pingTrig, HIGH);
delayMicroseconds(10);
digitalWrite(pingTrig, LOW);

duration = pulseIn(pingEcho, HIGH);

cm = duration / 29 / 2;

if(cm &lt; 10 ){
myservo.write(90);
delay(100);
}else{
myservo.write(0);
}
delay(2000);
}
Your include statement seems to be incomplete; add "Servo.h" to your include to make it look like this:

#include "Servo.h"


Without including "Servo.h", the compiler doesn't know what a servo is, and thus "Servo does not name a type".