Blinking LED with variable frequency

Hi,
I want to write a program, for blinking LED with the variable frequency of 10 - 100 Hz. I should use the potentiometer as a Voltage divider for generating the analogue input voltage.
I don´t know how shall I write the program. Could you please help me?

Start with the blink without delay example available from the file -> examples menu in the IDE.
Come back when you have a successfully blinking led and if you can’t work out how to change the period.

Do you know how to read a pot with an analogue input and get a value between 0 and 1023 ?

What range of values do you want for the period ?

Do you want like this --?
1. When input voltage is 0V, the LED (L of UNO) will blink at 1 Hz -- 1 blink in 1-sec time. That is to say, the interval between blinks is 1000 ms. The ON-period (timeDelay) of LED is 500 ms and the OFF-period is also 500 ms.

2. When input voltage is 5V, the LED will blink at 100 Hz - 100 blinks in 1-sec time. That is to say, the interval between blinks is 10 ms. The ON-period of LED is 5 ms and the OFF-period is also 5 ms.

3. For input voltage between 0V and 5V, the blink rate will be proportionate.

4. If the answer is yes, then the following codes may be helpful.

while(1)    //keep doing the following task.
{
   byte timeDelay = map(analogRead(A0), 0, 1023, 500, 5);  //pot is connected at A0-pin
   digitalwrite(13, HIGH);    //built-in LED (L) of UNO is connected with DPin-13.
   delay(timeDelay);
   digitalWrite(13, LOW);
   delay(timeDelay);
}

When is our assignment due to be handed in?

kasrat:
Hi,
I want to write a program, for blinking LED with the variable frequency of 10 - 100 Hz. I should use the potentiometer as a Voltage divider for generating the analogue input voltage.
I don´t know how shall I write the program. Could you please help me?

Hi kasrat,

your question is very general :"I don´t know how shall I write the program. Could you please help me?"

there is a lot of room for interprating what you expect as the answer.
As long as you do not ask in a more specific way, my answers are of a very general way

I recommend reading this tutorial
Arduino Programming Course

It is easy to understand and a good mixture between writing about important concepts
and get you going.

When you learned to ride a bike. Did you start in a halfpipe trying do do backloop-jumps?
Surely not. It's the same thing with learning programming. Though it is not as dangerous as having a crash in a half-pipe. You will moving up the learning-curve much faster if you take 3 or 4 hours time to work through this introductional tutorial.

best regards Stefan