void setup(){ Serial.begin(9600); //start the serial port in order to write pinMode(2,INPUT); // set the pin 2 to input } void loop(){ int val = digitalRead(2); //read from the pin 2 if(val==LOW) //if the current is low (i.e. pressed) then Serial.println(“LOW”); //let me know }