analog inputs+time

Hi. I had a necessity to change speed of run of running fires potentiometer in limits from 50ms to 5000 ms advise as it there is nothing to realize earlier the such didn't do and I do not represent as it correctly to realize.

That is a pretty incoherent sentence as read in English. Can you try again?

Lefty

I from Russia am sorry. It is necessary to change a temporal time delay between switching-on of a row from 8 LEDs which to be lit sequentially (effect of traveling wave) This time delay should change a potentiometer connected on an analog input arduino in limits from 50ms to 5000ms.

if you want a delay that is proportional to a pot value, use the analogRead and Map functions:

int potValue = analogRead(0); // read a pot on analog pin 0
// define minDelay and maxDelay for the range you want.
int duration = map(potValue, 0, 1023, minDelay, maxDelay);
delay(duration);

Here so it is correct? Or I that haven't added that in the code?

define minDelay 50 // Lower bound of a range of 0,5 seconds

define maxDelay 5000 // Upper bound of a range of 5 seconds

int ledPin = 13; int potValue = 0;

void setup(){ pinMode(ledPin, OUTPUT); analogReference(INTERNAL); // We select internal reference supply source for ADC }

void loop(){ int potValue = analogRead(4); //We read value of an analog input 4 to which the potentiometer is connected int duration = map(potValue, 0, 1023, minDelay, maxDelay); digitalWrite(ledPin, HIGH); delay(duration); digitalWrite(ledPin, LOW); }

Close, but it'll look like the LED is on all the time. Put in another delay(duration); after digitalWrite(ledPin, LOW);

Thanks have helped

#define minDelay 50     // Lower bound of a range of 0,5 seconds
#define maxDelay 5000 // Upper bound of a range of 5 seconds

By convention, #defined names have all capital letters. Other variable names do not. Violate this convention at your own risk.