Can you explain what you have.
There is a mechanical valve ?
And you want to control it with a servo ?
Can you use an electrial valve, and control that with the Arduino ?
Do you have the servo connected ?
You need the Servo library. In the Arduino, import the Servo library.
http://arduino.cc/it/Reference/ServoCan you make the servo to rotate to a certain position ?
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
if (....) // for example check a button.
{
myservo.write(0); // for example position 0 for valve 'on'
}
else
{
myservo.write(180); // for example position 180 for valve 'off'
}
delay(1000);
}
Please do reply to this post, so I know that you have read it.