Questions about Programming a Servo Motor [Solved]

Do you have a SERVO, or servo MOTOR ?
Big difference... one needs the servo library or similar, the other uses an h-bridge or driver to provide the control voltage.
Servos have all the goods in a single box, usually for RC hobby applications.
Servo motors are usually seen in larger automation / industrial control projects.

I have servos. Not servo motors. However, they are both called servo motors, but one is RC servo motors, and the other is industrial servo motors

incorrect. a servomotor is a type of (usually) dc motor.

Do you Serial.prints produce the expected results?

No, it does not

spencerkim:
No, it does not

Well, what do you see?

You know, the more detail you offer, the quicker the debug process will be.

Also:

myservo.attach(2);        //attach servo to pin 9

Why does your comment say pin 9 but your call to attach references pin 2?
The Servo library only supports pins 9 or 10.

Edit: N/M, misread library reference...

The Servo library only supports pins 9 or 10.

Where did you get that information?

Servo library reference.

AnalogWrite on pins 9 and 10 are disabled by the Servo library.

groundFungus:
Where did you get that information?

Servo library reference.

AnalogWrite on pins 9 and 10 are disabled by the Servo library.

Apologies, my mistake: I read this:

but only just noticed that applied to "...Arduino 0016 and earlier...".

I got that information from my friend. I see the light coming on the water sensor and the servo motor not turning on. Where am I suppose to connect the servo motor?

Well, that depends on whether it’s an RC servo or a servo motor,
Please post a link to the product or datasheet

I suggest that you split

  setTheServo(readTheSensors());

so that you can print the value returned by readTheSensors() to see whether it matches your expectations

What do you see when you print currentSensorVal ?

You might want to supply a diagram of your wiring. There is not enough current available on the 5V pin on the arduino to power a servo and I guess that is your problem.

Diagram of my wiring

OPS IMAGE

The diagram fails to illustrate if the power supply is a 9V battery wired directly to the breadboard?

The 9V power supply is connected to the Arduino Uno board.

The 9V power supply is connected to the Arduino Uno board.

Is the servo powered by the Uno 5V (see reply #21)? Or is the servo powered by 9V? Is the servo rated for 9V, if so?

The servo is powered by the Uno 5V not the 9V battery itself