Ben
Well-known member
The Metro library will be helpful with your LED blink thing.
@josh, delay will prevent you doing other things while it is operating. However a simple counting routine could be done within a for loop,but this may introduce other issues regarding access to the programme that you would need to think about. A for loop would go something like:
for(int x=10; x>0; x--){
pinlow;
delay(x);
pinhigh;
delay(x);}
the problem would then be that the delays get so short that the led would get dimmer and dimmer as the on time is shortened.
an option would be to have a separate function that contains the blink, with a fixed on time, such as:
void blink() {
pinlow;
delay(200);
pinhigh;
}
(or whichever way high and low go, )
and in your for loop use:
for..... {
blink();
delay(x);
}