int led[]={0,1,2,3,4,5,6,7};
int mtime=0;
int t;
int pot=A0;
int potdurum;
int ctime;
void setup() {
// put your setup code here, to run once:
for(int i =0; i<8; i++){
pinMode(i, OUTPUT);
}
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
ctime=millis();
for(int i=0; i<8;i++){
if(ctime- mtime>t){
digitalWrite(led[i], LOW);
if(i==8){
i==0;
}
mtime=millis();
}
}
for(int i=0;i<8;i++){
potdurum = analogRead(A0);
potdurum = map (potdurum, 0, 1023, 50, 2000);
digitalWrite(led[i],HIGH);
delay(potdurum);
digitalWrite(led[i],LOW);
}
}