// Button Waiting int pbPin = 4; // read the button void setup( ) { int startClick = LOW; //Initial state: no click yet pinMode( pbPin, INPUT ); Serial.begin(9600); while ( ! startClick ) { startClick = digitalRead( pbPin ); Serial.println("Waiting for button press"); } } void loop() { int button; button = digitalRead(pbPin); if (button == HIGH) { Serial.println("on"); } else { Serial.println("off"); } }