What is the output of “pin1” if “pin2” is sent “1011” where 1 is 5V and 0 is 0V?int pin1 = 12;int pin2 = 11;void setup() { pinMode(pin1, OUTPUT); pinMode(pin2, INPUT); Serial.begin(9600);}void loop() { if(digitalRead(pin2)==1) {digitalWrite(pin1,LOW); } else if(digitalRead(pin2)==0) {digitalWrite(pin1,HIGH); }}

🎲 Try a Random Question  |  Total Questions in Quiz: 51  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Arduino Practice Test — practice the complete quiz, review flashcards, or try a random question.


What is the output of “pin1” if “pin2” is sent “1011” where 1 is 5V and 0 is 0V?<br>int pin1 = 12;<br>int pin2 = 11;<br>void setup() {<br> pinMode(pin1, OUTPUT);<br> pinMode(pin2, INPUT);<br> Serial.begin(9600);<br>}<br>void loop() {<br> if(digitalRead(pin2)==1) {<br>digitalWrite(pin1,LOW);<br> }<br> else if(digitalRead(pin2)==0) {<br>digitalWrite(pin1,HIGH);<br> }<br>}