Arduino-流水灯模块
2020-01-01 10:55
1、实验材料
(1)UNO R3板 (2)流水灯
2、连线图
3、Mixly编程
4、扩展:Arduino IDE编程
int BASE = 2;int NUM = 13;int delayTime=100;void setup(){for (int i = BASE; i < BASE + NUM; i ++){pinMode(i, OUTPUT);}}
void loop(){for (int i = BASE; i < BASE + NUM; i ++){digitalWrite(i, LOW);delay(delayTime);}for (int i = BASE; i < BASE + NUM; i ++){digitalWrite(i, HIGH);delay(delayTime);}}
5、实验现象
声明:本文章由网友投稿作为教育分享用途,如有侵权原作者可通过邮件及时和我们联系删除:freemanzk@qq.com