LED Help

I have two servos hooked up to a water sensor… I want the led to turn on when the water sensor is wet and the servos move… the code I’m using makes the led stay on constantly any ideas on how I can make this happen?

This is my code:

#include <Servo.h>
Servo myServo;
Servo myServos;

int const potPin = A0;
int const potPins = A1;
int const potPinss = A2;
int potVal;
int potVals;
int potValss;
int angle;
int angles;
int angless;
int led = 10;

void setup() {

pinMode(led, OUTPUT);


void loop() {
potValss = analogRead(potPinss);
Serial.print("potPinss; ");
potVal = analogRead(potPin);
Serial.print("potval; ");
potVals = analogRead(potPins);
Serial.print("potvals; “);
angle = map(potVal, 0 - 900, 1023, 1 - 90, 150);
angles = map(potVals, 0 - 900, 1023, 1 - 90, 150);
angless = map(potValss, 0 - 900, 1023, HIGH, LOW);
digitalWrite(led, HIGH);
Serial.print (”, angle: “);
Serial.print(”, angles: “);
Serial.print(”, angless: ");
Serial.println(led, HIGH);



 Serial.println(led, HIGH);


the code I’m using makes the led stay on constantly

If you turn a light on, and never turn it off, are you surprised if it’s always on?

Trying to turn the led on if you read through the code you should see what I’m trying to do with the explanation

You're trying to turn the LED on with a serial print?

I am trying to move two servos off a water sensor that acts as the switch… I want the led to turn on when the water sensor has water on it… Dose that help?

Analog reads always return positive values, so I'm a little confused by the zero minus nine hundred in the map calls.

the water sensors values are between 0 - 1023 and i am trying to make it light up from those values

Ive set it to 0 -900 just for sensitivity on the servos

That's doesn't mean 0 to 900, it means 0 minus 900. I would suggest reading the reference page for the map function.

Really, I would recommend working through some of the examples that come with the IDE, you appear to have zero clue what's going on here. If you'll work through some of the basic stuff you'll see how to do what you want pretty easy.

yeah I'm just a bit lost with connecting the led up to the water sensor. I have the servos working perfectly and have done for weeks but its just the led's that I have just decided to add that are causing me problems.