hi I am totally new to Arduino and am learning the analog input using a potentiometer and LEDs, where you control the LED on off with a potintiometer.
I want to go one step further and link the the min and max of my potentiometer to time lets say 0 to 60 second. Can some one help me please.
I tried to use the map function to achive this but was unsuccessful can some one please guide me on how to.
void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
// turn the ledPin on
digitalWrite(ledPin, HIGH);
// stop he program for milliseconds:
map(sensorValue, 0,1023,0 millis, 60000 millis);
delay(sensorValue);
// turn the ledPin off:
digitalWrite(ledPin, LOW);
// stop the program for for milliseconds:
delay(sensorValue);
}