#define RED 9
#define GREEN 10
#define BLUE 11
float v;
int i;
int data;
void setup() {
  // put your setup code here, to run once:
pinMode(RED, OUTPUT);
pinMode(BLUE, OUTPUT);
pinMode(GREEN, OUTPUT);
Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
data = analogRead(A0);
v = (data/1023.0)*5;
Serial.print(" Vin = ");
Serial.print(v);
Serial.print(" , data = ");
Serial.print(data);
Serial.print(" = ");
Serial.println(data,BIN);
data=map(data,0,1023,1,4);

if (data == 1)
{
  digitalWrite(RED, HIGH);
digitalWrite(GREEN, 0);
digitalWrite(BLUE, 0);
}
else if (data == 2)
{
  digitalWrite(RED, 0);
digitalWrite(GREEN, 0);
digitalWrite(BLUE, 1);
}
else 
{
  digitalWrite(RED, 0);
digitalWrite(10, 1);
digitalWrite(BLUE, 0);

}
delay(1000);
}