Turn off rick roll

Embarrassingly noob question. Where/how do I add a switch to activate this, and turn it off when pressed?
I tried a NO switch, with a digital pullup resistor. [int Trigger = 0; pinMode(3, INPUT_PULLUP); Trigger = digitalRead(3);]
Then I tried IF and WHILE loops, immediately after my digitalRead statement. I tried these to loop the code portion from when the ledPin is energised to when it is de-energised. Then I tried to also encompass FOR statement that indexes "thisNote".
Nothing worked. I gave up and put my switch connecting ground to the RESET pin. Works, but has a delay to start the song and lights.

It seems to me that your question has nothing to do with other posts in the topic.
Please start a new thread.

Before it, read the forum guidelines how to ask a good question. Do not describe the code in words, insert the code itself.

Take me to your new topic...

@running_fatguy, please do not hijack. Thread split.

The potentiometer above the threshold activates the melody, and deactivates the melody below the threshold.

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