// Using a momentary switch to change behavior // while holding it down // Variables int mySwitch = 0; int switchPin = 8; // Setup void setup() { Serial.begin(9600); pinMode(switchPin, INPUT); } // Das loop... void loop() { // Look for the switch's status in every cycle of the loop. // Note that the switch is set to be normally HIGH mySwitch = digitalRead(switchPin); Serial.println(mySwitch); }