#define RED 9
#define BLUE 8
#define GREEN 7
int data;
float v;
void setup()
{
Serial.begin(9600);
pinMode(RED, INPUT);
pinMode(BLUE, INPUT);
pinMode(GREEN, INPUT);
Serial.println("insert a NUMBER");
}
void loop()
{
data=map(data, 0, 100 ,1, 4);
v = (data / 1023.0) * 5 ;
if (data == 1)
{
digitalWrite(GREEN, 1);
digitalWrite(BLUE, 0);
digitalWrite(RED, 0);
delay(500);
}
if (data ==2)
{
digitalWrite(GREEN, 0);
digitalWrite(BLUE, 1);
digitalWrite(RED, 0);
delay(500);
}
if (data == 3)
{
digitalWrite(GREEN, 0);
digitalWrite(BLUE, 0);
digitalWrite(RED, 1);
delay(500);
}
if(data == 4)
{
digitalWrite(GREEN ,1);
digitalWrite(BLUE , 1);
digitalWrite(RED ,1);
delay(500);
}
}