Study the following circuit: Definitions S1 = 0 / S2 = 0 means the button is pressed down S1 = 1 / S2 = 1 means the button is not pressed down Question Suppose S1 = 0 Suppose S2 = 0 void setup() { Serial.begin(9600); pinMode(13, OUTPUT); pinMode(2, INPUT); pinMode(3, INPUT); } void loop() { delay(2000); int button1_val = !digitalRead(2); // button1_val = 1 when pressed, 0 when not pressed int button2_val = !digitalRead(3); // button2_val = 1 when pressed, 0 when not pressed if (button1_val == 1 && button2_val == 1) { // AND = && (both of them) digitalWrite(13, 1); // turn on } else { digitalWrite(13, 0); // turn off } } Use the following codes to describe the state of the LED, and values of the variables. Your answer should either be 0, 1, 2, 3, 4, 5, 6, or 7. If your answer is 0, Canvas might flag the question as unanswered. It is safe to ignore this message. CODE LED button1_val button2_val 0 OFF 0 0 1 OFF 0 1 2 OFF 1 0 3 OFF 1 1 4 ON 0 0 5 ON 0 1 6 ON 1 0 7 ON 1 1简答题

登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
类似问题
Given the logic diagram below, complete the truth table below. [table] A | B | C | Q 0 | 0 | 0 | Blank 1 Question 1 01 0 | 0 | 1 | Blank 2 Question 1 01 0 | 1 | 0 | Blank 3 Question 1 01 0 | 1 | 1 | Blank 4 Question 1 01 1 | 0 | 0 | Blank 5 Question 1 01 1 | 0 | 1 | Blank 6 Question 1 01 1 | 1 | 0 | Blank 7 Question 1 01 1 | 1 | 1 | Blank 8 Question 1 01 [/table]
Question at position 3 What will the following code output? a = (True and (not False or (True and False))) b = not (False and (not True or (True and False))) c = True and (not (True and (False or True))) print(a, b, c)True True FalseFalse True FalseTrue False FalseFalse True TrueClear my selection
Question at position 1 The achieve a pass in INFO1110 you must:(Pass the Foundation Test) AND (Pass the Foundation Assignment)(Pass the Foundation Test)(Pass the Foundation Test) OR (Pass the Foundation Assignment)(Pass the Foundation Assignment)Clear my selection
The following application was developed to allow a user to guess a number between 0 and 10. If a number between 0 and 10 is entered, the number is not accepted.How can this error be removed?
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!