Random flash light with button

Thanks to all of you. And sorry if I waste your time that was not my intention. I will get back into the Arduino soon. The setup with the 555 timer and some relays does exactly what I want to do.

I'm glad you got something working. The 555 is a venerable analog circuit that has gazillions of applications. There is a lot to learn in there!

I don`t understand why nobody is helping in a decent way. No offence here!! I love all of you guys.
...

Well, 'love' is a strong term, but this is a great place for the highest level of noob guidance.

... But why nobody is helping in a decent way? ...

I dunno - you asked a question, I answered in about 5 minutes later, and even provided an example of how to merge two working sketches. You didn't acknowledge my efforts, but went in a different direction. ... That's ok though, I'm still following.

... But if I am new in something the best way to learn ( in my eyes) is to copy and learn. The hurdle to get this working are so high in my eyes because the topic is complex. So many projects I lost my interest because debugging was so complicated.

I was always wish to find a project ready made I could follow.
...

Ok, bur that is not how it's done here. We believe that anyone can program an Arduino. It takes certain skills, and you need to put some effort in, but with all the guidance here, the reality is that (mostly) everybody can program. As long as you have the drive, folks here will stick with you, and adjust their guidance to your style. It's like course in microcontrollers where there is a teacher for every learning style and level of knowledge.

You might have guessed from my dialog, I am a science, engineering and technology teacher. I've been at it for many decades. In my experience, noobs do not learn much by copying projects. They learn from expanding on already done projects, but the real learning comes when something doesn't work as expected, and the learner needs to synthesize the answer from things already learned.

... I think what I wanted to do is so simple for you experts. But everyone is only giving tipps.
...

Just to prove I'm really a teacher, it's tips, not tipps.

But your assumption that it's simple just is not correct. If it were simple, you wouldn't need experts. Making anything exactly like you want it, always involves specific complications.

And I gave you two complete, compilable examples. Considerably more than tips!

... Would it not the best to have a ready made code from someone and then following how they did it?

No, that's not the best way to learn a subject like this. There are lots of sites however that do have ready made projects! instrucables.com, littlebits.com, hackster.io, electronicshub.org, makerspaces.com, and of course playground.arduino.cc/projects/. This is only a limited sampling - there are many, many more projects online with full source code, parts lists, schematics, and, well, everything you need to build the project. If you don't find the project you want to build, learn how to do it, and be the first!

These are all example sketches made to be able to add to each other.
I still have more to go but those show Input - Process - Output tasking without an OS.

The undelay sketch demonstrates one way to get rid of delays with a 1-shot timer and a state machine. The On-Off Blinker sketch shows one task controlling another. The button and led sketches are support for different wiring, single to matrix Input or Output.

addasketch_button.ino (4.65 KB)

addasketch_buttons.ino (5.62 KB)

addasketch_loop_counter.ino (1.25 KB)

addasketch_matrix_buttons.ino (4.47 KB)

addasketch_multi_blinkers.ino (3.58 KB)

addasketch_on_off_blinker.ino (2.78 KB)

addasketch_status_blinker.ino (1.22 KB)

addasketch_undelay.ino (3.16 KB)

blink_w_serial_control.ino (1.12 KB)