@lingdantiancai
2016-05-06T15:38:19.000000Z
字数 442
阅读 1978
第一讲
arduino_blink
注意: 电阻很有必要存在,要不然非常容易烧灯泡
按照上图连接好电路以后我们就可以上代码了
代码其实很简单
void setup() {
// 初始化13号引脚为输出.
pinMode(13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
上传上去你就可以看到一闪一闪的小灯泡了
Blink视频
Edit: by lingdantiancai