点亮arduino uno r3板载 / 外接led灯
1、准备工作与开发板选择 2、选择端口 3、代码: // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN (13) 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 second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } 4、代码上传与验证 点击上传按钮,等待编译完成后,Arduino开发板上的板载LED灯将开始按程序设定的1秒间隔闪烁。这是最基础的Arduino入门实验,验证了开发环境配置正确且开发板工作正常。