填空题
三人抢答器的软件程序代码如下:int redled = 11;int yellowled =12;int greenled = 13;int redpin = 7;int yellowpin = 8;int greenpin = 9;int offswitch = 10;int red;int yellow;int green;int i = ; //①void setup(){pinMode(redled, OUTPUT);pinMode(yellowled, OUTPUT);pinMode(greenled, OUTPUT);pinMode(redpin, INPUT);pinMode(yellowpin, INPUT);pinMode(greenpin, INPUT);pinMode(offswitch, INPUT);}void loop(){ red = (redpin); //②if (red == HIGH && i == 0){ i = 1;digitalWrite(redled, HIGH);}yellow = digitalRead(yellowpin);if (yellow == HIGH&&i == 0){ i = ; //③digitalWrite(yellowled, HIGH);}green = digitalRead(greenpin);if (green ==HIGH && i == 0 ){i=1;digitalWrite(greenled, HIGH);}if (digitalRead(offswitch) == HIGH){ i = 0;digitalWrite(redled, LOW);digitalWrite(yellowled, LOW);digitalWrite(greenled, LOW);}}在以上程序中①处int i =②处red =(redpin); ③处i =; 该程序设计采用了(单、双、多)分支选择结构。
套餐购买该问题答案仅对会员开放,欢迎开通会员 ¥ 19.9
0.64/天
1个月(不限次)
¥ 19.9
1000次
(不限时)
¥ 29.9
0.32/天
3个月(不限次)
¥ 59.9
0.16/天
1年(不限次)
立即支付