提交 65a5e3af 编写于 作者: mysterywolf's avatar mysterywolf 提交者: guo

[arduino] 优化默认代码

上级 0fe1d152
...@@ -10,17 +10,15 @@ ...@@ -10,17 +10,15 @@
#include <Arduino.h> #include <Arduino.h>
uint8_t led = LED_BUILTIN;
void setup(void) void setup(void)
{ {
/* put your setup code here, to run once: */ /* put your setup code here, to run once: */
pinMode(led, OUTPUT); pinMode(LED_BUILTIN, OUTPUT);
} }
void loop(void) void loop(void)
{ {
/* put your main code here, to run repeatedly: */ /* put your main code here, to run repeatedly: */
digitalWrite(led, !digitalRead(led)); digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
delay(100); delay(100);
} }
...@@ -10,17 +10,15 @@ ...@@ -10,17 +10,15 @@
#include <Arduino.h> #include <Arduino.h>
uint8_t led = LED_BUILTIN;
void setup(void) void setup(void)
{ {
/* put your setup code here, to run once: */ /* put your setup code here, to run once: */
pinMode(led, OUTPUT); pinMode(LED_BUILTIN, OUTPUT);
} }
void loop(void) void loop(void)
{ {
/* put your main code here, to run repeatedly: */ /* put your main code here, to run repeatedly: */
digitalWrite(led, !digitalRead(led)); digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
delay(100); delay(100);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册