// Footswitch function, returns 0 or 1 relative to state of switch int footcheck() { int footval = 0; footval = digitalRead(footpin); return(footval); }