How to make a four input led timer

How do I make four-input led timer with different times on a uno. Ex. input 1, 20 sec. output input 2. 7sec. output Input 3, 30 sec output INPUT 4, 45 sec output

Have you done anything with an Arduino at all? Looked at the example files?

And how should it react when you press a button (is that even what you use???) is the output is on?

In psuedo code it will be something like:

const unsinged int outputDelays[] = {20000, 7000, 30000, 45000};
unsinged long millisOutputOn;
byte delayMode;

for(byte i = 0; i < 4; i++){
  if(input[i] is presseed){
    millisOutOn = millis();
    delayMode = i;
    digitalWrite(ouput, HIGH);
    break;
  }
}


if(millis() - millisOutputOn > outputDelays[delayMode]){
  digitalWrite(output, LOW);
}

You just have to fill in the gaps and describe the behavior more complete.

septillion: Have you done anything with an Arduino at all? Looked at the example files?

Specifically, you should look at the BlinkWithoutDelay example, which is also explained very well in this video.

OK! I have very little knowledge of how to program an uno. I am chairman of a pistol shooting association in Sweden and we need the UNO to control pneumatic rotary targets through digital LED output 13. We can pay a symbolic sum to the person who comes with a working program

EX:

When I press the input 1 Button Led low 7sec. Led high 3sec. Led low 7sec. Led high 3sec. Led low 7 sec. Led high 3sec. Led low 7sec. Led high 3sec. Led low 7sec. Led high 3sec. Led low 20sec.

Led High / End of sequence

When I press the input buttons 2 Led low 7sec. Led high 6sec. Led low 20sec.

Led High / End of sequence

When I press the input button 3 Led low 7sec. Led high 8SEC. Led low 20sec.

Led High / End of sequence

When I press the input button 4 Led low 7sec. Led high 10sec. Led low 20sec.

Led High / End of sequence

When I press the input button 5 Led low 7sec. Led high 20sec. Led low 20sec.

Led High / End of sequence

When I press the input button 6 Led low 7sec. Led high 150sec. Led low 20sec.

Led High / End of sequence

Hmmm.

Seems you have omitted to indicate which LEDs/ targets should be activated at each step!

Also, you need to specify interaction between buttons - what option do you wish to have to abort a sequence, or have concurrent sequences.

This is all the critical part of planning a program - you have to know what you actually need it to do. :grinning:

PM me and I can help you. There will be more details required.

marco_c: PM me and I can help you.

It is, of course, your decision to help via PM. However, one of the biggest advantages of a forum like this is the sharing of knowledge in public.....

I get that Jimbo, but often getting the details from newbies is less intimidating if done away from those on the forum who feel the need to reinforce their technical superiority in unhelpful ways. I'll post anything that results.

So you are going to tell him what I told him, but in a PM?