And how exactly does the pin7 know that it is active ?
The pin 7 has an internal pull-up, it is there by default, you dont need to define it, but in all the codes compressed in the rar file in
www.electrosmash.com/forum/software-peda...-pedalshield?lang=en (I suggest you to use this codes, they are the latest and greatest) are defined to make it more clear like:
int FOOTSWITCH = 7;
pinMode(FOOTSWITCH, INPUT_PULLUP);
So if you see, the hole circuit will be something like this:
Son when it is pushed, the pin 7 is connected to ground (and the Arduino reads a '0') and when is not pushed the arduino sees the pull-up resistor which is 3V3.
In the code is detected like this:
//Turn on the LED if the effect is ON.
if (digitalRead(FOOTSWITCH)) digitalWrite(LED, HIGH); // effect ON
else digitalWrite(LED, LOW); //effect OFF