6785| 12
|
[讨论交流] arduino uno 按钮检测怎么实现 |
我稍微改动了一下,按钮开关控制串口输出和LED灯的亮灭 [mw_shl_code=c,true]void setup() { Serial.begin(9600); } void loop() { if (digitalRead(2)) { Serial.println("hello"); digitalWrite(13, LOW); delay(5000); } else { Serial.println(" how do you do?"); digitalWrite(13, HIGH); delay(1000); } }[/mw_shl_code] 串口输出 |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed