6520| 4
|
[讨论] 0基础 Arduino点至设计实战指南红绿灯控制出问题请求帮忙 |
年纪小书上的好多话都理解,这个程序照着书上抄的,不知道哪里出了问题总是提示出差错 void setup() { //pinMode(redLed ,OUTPUT); pinMode(YellowLed ,OUTPUT); pinMode(greenLed ,OUTPUT); } void loop() { dingitalWrite(redLed,HIGH); dingitalWrite(YellowLed,LOW); dingitalWrite(greenLed,LOW); delay(6000); dingitalWrite(redLed,LOW); dingitalWrite(YellowLed,LOW); dingitalWrite(greenLed,HIGH); delay(6000) dingitalWrite(redLed,LOW); dingitalWrite(YellowLed,HIGH); dingitalWrite(greenLed,LOW); delay(2000) } |
是这样吗? int redLed=10; int YellowLed=9; int greenLed=8; void setup() { // put your setup code here, to run once: void setup() { //pinMode(redLed ,OUTPUT); pinMode(YellowLed ,OUTPUT); pinMode(greenLed ,OUTPUT); } void loop() { // put your main code here, to run repeatedly: dingitalWrite(redLed,HIGH); dingitalWrite(YellowLed,LOW); dingitalWrite(greenLed,LOW); delay(6000); dingitalWrite(redLed,LOW); dingitalWrite(YellowLed,LOW); dingitalWrite(greenLed,HIGH); delay(6000) dingitalWrite(redLed,LOW); dingitalWrite(YellowLed,HIGH); dingitalWrite(greenLed,LOW); delay(2000) } |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed