//initializing all pins to be used
int potent = A4;
int RedledPin = 12;
int YellowledPin = 10;
int GreenledPin = 8;
int x = 0;
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(A4, INPUT);
pinMode(RedledPin, OUTPUT);
pinMode(YellowledPin, OUTPUT);
pinMode(GreenledPin, OUTPUT);
}
void loop()
{
// put your main code here, to run repeatedly:
x = analogRead(potent);
//Serial.printIn(x);
digitalWrite(RedledPin, HIGH);
delay(x);
digitalWrite(RedledPin, LOW);
delay(x);
digitalWrite(YellowledPin, HIGH);
delay(x/2);
digitalWrite(YellowledPin, LOW);
delay(x/2);
digitalWrite(GreenledPin, HIGH);
delay(x);
digitalWrite(GreenledPin, LOW);
delay(x);
}