I need you help in some code. I am very new to arduino and im looking to do this
However add an additional red static light and some sort of chase or pulsing red setting.
So i want it to work exactly the same way but add three quick up presses making the static red light with sound activate and then downwards three time to make a cashing (like the double press down blue version) red with sound activate.
If any of you clever people could give me code help or some pointers that would be great
Look, this is all i have. I really am a beginner and i am looking for some help. That is the code i am using and it works to get my leds to 'chase' at the correct speed. I need to know how to add sound and how to add a double press switch that will switch off when i let go. Similar to the video above. If i haven't provided the correct information its because i do not know it. I f you need more please, without being patronising, let me know what else you need
We need [ code ] tags. Your code has been mangled by the forum software. We can't tell you what's wrong as some of that is not mistakes you made. It also makes it easier for users of some display devices such as tablets to have the code in a defined code window.
i'll be honest i dont know how to do that. I have copied and pasted what i used of arduino straight to here. Tell me what to do. I dont know what else to provide.
To allow the thing to do different things at different times, you need a state machine. You will end up with a surprisingly large number of states: button-down-first, button-up-first, button-down-second, button-up-second...
Start with drawing the state diagram. Every single change on the button will be a new state. Then changeLED() can do different things depending on which state it's in.