2. Arduino GPIO Programming Basics

Question.4

Sarah is working on a project. She sets up her Arduino code as given below. Analyze the given code and circuit diagram to determine, What will Sarah see on the Serial Monitor if the button is not pressed.

void setup() {
  pinMode(7, INPUT_PULLUP);
  Serial.begin(9600);

  int buttonState = digitalRead(7);
  Serial.println(buttonState);
}

void loop() {
}

Select Answer