Question.3
Kevin has built the following circuit. When will the LED turn ON?
void setup() { pinMode(4, OUTPUT); pinMode(2, INPUT_PULLUP); } void loop() { int buttonState = digitalRead(2); if (buttonState == HIGH) { digitalWrite(4, HIGH); } else { digitalWrite(4, LOW); } }
Select Answer
The LED will glow only when the button is pressed.
The LED will not glow at all irrespective of a button press.
The LED will stay ON contentiously irrespective of a button press.
The LED will glow when the button is not pressed.