int switchValue; //introduce a new variable
void setup() {
Serial.begin(9600); //initiate serial communication
pinMode(2, INPUT); //pin 7 is an input
}
void loop() {
switchValue = digitalRead(2); //read from pin and store value
Serial.println(switchValue); //print values to serial monitor
}