About 2 led random turn on and 2 sec off

Hello guys I am making project about 2 LEDs randomly turn on and after 2 second turn off. I am beginner in Arduino and have a very basic experience in it.

So the application goes like this.

There is 2 buttons (button1 and button2) and 2 LEDs(led1 and led 2)

When I press button1, after some random time(different random times for LEDs) led 1 and 2 will be on on different times, any led that is turned on will be turned off after 2 seconds.

Like for example led 1 will be turned on after between 10 to 15 seconds, and after that, it will turn off after 2 seconds. led 2 will be turned on after between 15 to 20 seconds, and after that, it will turn off after 2 seconds.

When button 2 pressed, both led will be off and neither led1 or led 2 will turn on until I press button1 again.

So this is my application, I hope i can get any help.

Thank You.

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

The above should be of help when you post your code.

Well now I moved it out of the section that is just for getting the IDE working someone might help, once you have posted your code and schematic.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.