analogRead Basic Help.

What's wrong with the even simpler version?

  if (sensorValue >500) digitalWrite(Relay, HIGH);
  else digitalWrite(Relay, LOW);

Steve