1. Arduino GPIO Basics

Question.5

Alex writes the given code. Analyze the given code and circuit diagram to determine what Alex will see on the Serial Monitor if the switch connected to pin 7 is not pressed.

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

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

Select Answer