40| 2
|
[求助问答] else if(val <= 800 && val > 500) 在mind+模块里怎么表达? |
if (val > 800) { digitalWrite(redled,HIGH); digitalWrite(greenled,LOW); digitalWrite(yellowled,LOW); Serial.println("红色LED点亮"); } else if(val <= 800 && val > 500) { digitalWrite(greenled,HIGH); digitalWrite(redled,LOW); digitalWrite(yellowled,LOW); Serial.println("绿色LED点亮"); } else if (val <= 500) { digitalWrite(yellowled,HIGH); digitalWrite(greenled,LOW); digitalWrite(redled,LOW); Serial.println("黄色LED点亮"); } |
© 2013-2025 Comsenz Inc. Powered by Discuz! X3.4 Licensed