/* * Programmer R. Jordan Kreindler * October 9, 2020 * Sketch to check if switch is pressed * If switch not pressed value = 1 or HIGH * If switch pressed value = 0 or LOW */ #define Switch 8 #define delay1 500 void setup() { pinMode (Switch, INPUT_PULLUP); // Set the switch as input, so that when not pressed the value equals one (1) Serial.begin(9600); } void loop() { Serial.print("Encoder Switch = "); Serial.println(digitalRead(Switch)); // print current value of Switch delay(delay1); }