Question.2
Kevin has built the following circuit. By running which of the following programs on Arduino will damage its GPIO when the switch is pressed?
Select Answer
#define GPIO 4 void setup() { pinMode(GPIO, INPUT_PULLUP); } void loop() { bool readState = digitalRead(GPIO); }
#define GPIO 4 void setup() { pinMode(GPIO, OUTPUT); } void loop() { digitalWrite(GPIO, LOW); }
#define GPIO 4 void setup() { pinMode(GPIO, OUTPUT); } void loop() { digitalWrite(GPIO,HIGH); }
#define GPIO 4 void setup() { pinMode(GPIO, INPUT); } void loop() { bool readState = digitalRead(GPIO); }