HELP! How to make a single LED flash 20 times at 4 seperate rates?

Hi! I am new to the adruino program I am working on a project and I need help with finding a way for the LED to flash 20 times for 4 different rates starting with: 20ms, then 40ms, then 80ms, and then 100ms. Please help maybe with an exampe!

This part of the forum is where you write the code, and we iron out the problems.

If your program has nothing else to do, then you could use delay()

Do you know how to flash a LED for 20ms. Then you could use a "for" loop that repeats that flashing 20 times. The delay time could be a variable, holding the flash times.

Post the code you have so far. Leo..

Hi,
Welcome to the Forum

If you look in examples in the IDE, you will find a sketch called “blink without delay”
It should help you get started.
Other examples will show you how to use input switches.

Tom… :slight_smile:

Please help maybe with an exampe!

OK once you have explained the difference between an example and doing all the code for you.