int analog_pin = 7;
float val;
int red_led = 9;
int yellow_led = 8;
int green_led = 7;

void setup() {
}

void loop() {

  digitalWrite(red_led, LOW);
  digitalWrite(yellow_led, LOW);
  digitalWrite(green_led, LOW);

  val = 1024 - analogRead(analog_pin);
  
  digitalWrite(red_led, HIGH);
  if (val > 341){
    
    digitalWrite(yellow_led, HIGH);
  }

  if (val > 682){

    digitalWrite(green_led, HIGH);
  }

}