0

3leds 1 button help me finish

I need help to finish this project: This is the circuit-http://prntscr.com/rqx9gk This is my unfinished code - http://prntscr.com/rqxaqw I need help with the code so the three leds(green,red,blue) work only when the first led(yellow) is ON. Some variables are named in my native language so if you dont understand just ask I will try to translate it or use google translate from slovak to english it should work just fine. Thanks for all your help in advance.

4/1/2020 3:12:23 PM

David

7 Answers

New Answer

+3

Thanks for mentioning me. Gordon

+2

David, I would make something like this int block =0; void loop( ){ if(digitalRead(button)== true && block ==1) { count++; block=0; delay(50); } if(digitalRead(button)==false) block=0; // use Switch case // to do what you want here switch(count){ case:0 // do something break; case:1 // do something break; //...... } }

+1

This is a warning to your repeated offense of posting "laziness" question in SoloLearn Q&A. https://www.sololearn.com/Discuss/2222839/?ref=app

+1

I see your screenshot of your attempt now. Now it is eligible for answering, I withdraw my previous warning. Instead of using a screenshot, use code playground : Please show your code here so that we can help you https://www.sololearn.com/post/75089/?ref=app

+1

arduino, so maybe... Pedro H.J ?

0

Man I need help what do you mean "laziness".Where should I post this then if not here

0

https://code.sololearn.com/cOc4inFvYJPj/#cpp here you go