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)
}
少了变量声明。
intredLed=9;
int YellowLed=10;
int greenLed=11; 是这样吗?
intredLed=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)
} 这次在图形编辑器里面编辑成功,但是遇到新问题,软件设定的是COM1但是电脑的端口是COM4根本没有1,咋么改呢? USB驱动安装正确了吗?不行再装一次。
页:
[1]