弄了一块uno,通过USB线连上电脑,装好驱动,她的"ON"灯亮了,还有"L"灯每隔1S闪一次。
然后我打开arduino 1.0, 打开File > Examples > 1.Basics > Blink,执行upload,“Done uploading”后TX,RX灯闪了几下就灭了,"L"灯一直都是每隔1S闪一次。
blink程序如下:
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}
麻烦大家帮我看看是什么原因。
还有,loop里的程序只执行一次,还是一直循环呢?
谢谢各位。 |