Question.6
Lisa uses the following code. She is observing the Serial Monitor. What will be printed on the Serial Monitor if the button is not pressed?
const int buttonPin = 2;
int buttonState = 0;
void setup() {
pinMode(buttonPin, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
buttonState = digitalRead(buttonPin);
Serial.println(buttonState);
}