建筑兔零基础Arduino自学记录47|安装和实战小灯闪烁-1
一、安装Arduino
arduino阿丢伊诺官网Arduino - Home
安装完毕
二、安装Mixly米思齐
软件平台 - Let's Mixly!
三、注册Tinkercad

这是在没有实体开发板的时候一个替代,免费网站。点击创建电路,即可开始一个项目。
补充以上一二三步均为基础环境布置。1为官方平台,2为国内自行开发平台,用于图示化编程,3为结合1和2同时解决手边没有实体板的问题。
四、实战Tinkercad——让板子上的灯闪烁
将选取的元件拖入工作区域, 选择喜欢的编辑模式
我这是是直接把亮灯的样例代码复制进去,点击开始模拟可以看到灯在闪烁了
样例代码如下:
/*BlinkTurns an LED on for one second, then off for one second, repeatedly.Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZEROit is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set tothe correct LED pin independent of which board is used.If you want to know what pin the on-board LED is connected to on your Arduinomodel, check the Technical Specs of your board at:https://www.arduino.cc/en/Main/Productsmodified 8 May 2014by Scott Fitzgeraldmodified 2 Sep 2016by Arturo Guadalupimodified 8 Sep 2016by Colby NewmanThis example code is in the public domain.https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
*/// the setup function runs once when you press reset or power the board
void setup() {// initialize digital pin LED_BUILTIN as an output.pinMode(LED_BUILTIN, OUTPUT);
}// the loop function runs over and over again forever
void loop() {digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)delay(1000); // wait for a seconddigitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOWdelay(1000); // wait for a second
}
也可以选用这样图示化的编程方式,直接拖拽更改部分内容就可模拟。
附:实物配件
如果用Mixly来编写的话,步骤:
之前我选过python但是控制部分只有打印没有需要的管脚,所以更改为Arduino AVR