plz i need help i don't know where is the probleme in this programm.

#include <LiquidCrystal.h>

#define trigger 10
#define echo 11
#define servo 9

LiquidCrystal lcd(7,6,5,4,3,2);

float time=0,distance=0;
int temp=0;
const int servoPin = 9; //Servo Pin

float Kp = 2.5; //Initial Proportional Gain
float Ki = 0; //Initial Integral Gain
float Kd = 1.1; //Intitial Derivative Gain
double Setpoint, Input, Output, ServoOutput

PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT); //Initialize PID object, which is in the class PID.

Servo myServo; //Initialize Servo.

void setup()
{
lcd.begin(16,2);
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
pinMode(motor, OUTPUT);
lcd.print(" Water Level “);
lcd.setCursor(0,1);
lcd.print(” Indicator ");
delay(2000);
Serial.begin(9600); //Begin Serial
myServo.attach(servoPin); //Attach Servo

Input = readPosition(); //Calls function readPosition() and sets the water level
// position as the input to the PID algorithm

myPID.SetMode(AUTOMATIC); //Set PID object myPID to AUTOMATIC
myPID.SetOutputLimits(0,100); //Set Output limits to 0 and 100.
}

void loop()
{
lcd.clear();
digitalWrite(trigger,LOW);
delayMicroseconds(2);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
delayMicroseconds(2);
time=pulseIn(echo,HIGH);
distance=time*340/20000;
lcd.clear();
lcd.print("Water Space In ");
lcd.setCursor(0,1);
lcd.print("Tank is: ");
lcd.print(distance);
lcd.print(“Cm”);
delay(2000);
if(distance<12 && temp==0)
Setpoint = 15;
Input = readPosition();

myPID.Compute(); //computes Output in range of 0 to 100 degrees

ServoOutput=102+Output; // 102 cm
myServo.write(ServoOutput); //Writes value of Output to servo
{
digitalWrite(servo, LOW);
lcd.clear();
lcd.print("Water Tank Full ");
lcd.setCursor(0,1);
lcd.print(“servo Turned OFF”);
delay(2000);
digitalWrite(LOW);
delay(3000);
temp=1;
}

else if(distance<12 && temp==1)
{
digitalWrite(servo, LOW);
lcd.clear();
lcd.print("Water Tank Full ");
lcd.setCursor(0,1);
lcd.print(“servo Turned OFF”);
delay(5000);
}

else if(distance>30)
{
digitalWrite(servo, HIGH);
lcd.clear();
lcd.print(“LOW Water Level”);
lcd.setCursor(0,1);
lcd.print(“servo Turned ON”);
delay(5000);
temp=0;
}
}
loat readPosition() {
delay(10); //Don’t set too low or echos will run into eachother.

const int pingPin = 7; //Trig Pin Arduino 7
const int pingPin2 = 6; //Echo Pin Arduino 6

long duration, cm;
unsigned long now = millis();
pinMode(pingPin, OUTPUT);
digitalWrite(pingPin, LOW);
delayMicroseconds(2);
digitalWrite(pingPin, HIGH);
delayMicroseconds(5);
digitalWrite(pingPin, LOW);

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

cm = duration/(29*2);

if(cm > 30) // 30 cm is the maximum position for the ball // make 35
{cm=25;} // make 30

Serial.println(cm);

return cm; //Returns distance value.
}

double Setpoint, Input, Output, ServoOutput

Missing a semi-colon to end the statement.

If you are going to use the PID library, shouldn't you #include the library before you create a PID instance?
If you are going to use the Servo library shuldn't you #include the library before you create a Servo instance?

pinMode(motor, OUTPUT);

Should that be servo?

loat readPosition() {

Float is a data type, loat is not.

digitalWrite(LOW);

Which pin to write low?

Fix those errors and try again.

Please read the "how to use the forum-please read" stickies to see how to post code and error messages.

Error messages not only tell you what is wrong but where to look for the error. For instance:

sketch_jun07c:86: error: 'else' without a previous 'if'

sketch_jun07c Tells you which file that the error is in.
86: Tells you the line number to start looking from. Sometimes the error is before that line number but close by.
error: Means an error that will not compile versus a warning that will allow compilation but should be addressed.
‘else’ without a previous ‘if’ The actual error description.

That is why we ask that you post the entire error message(s) (in code tags).

myPID.Compute(); //computes Output in range of 0 to 100 degrees

ServoOutput=102+Output; // 102 cm 
myServo.write(ServoOutput); //Writes value of Output to servo

What kind of servo do you have that can position between 102 and 202 degrees?!?

If you are using Output to control a servo, shouldn't the limits be 0 to 180? (Or 1000 to 2000 if you are using servo.writeMicroseconds()?) Or if your servo really does work over the 102 to 202 degree range, maybe set those as the output limits. "Output" is just a control value and you can use any range you like.