Created
May 21, 2019 09:31
-
-
Save ghostoy/fd2876eb16fe4c2109631dc661c7ba35 to your computer and use it in GitHub Desktop.
Arduino点亮LED灯
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int ledPin = 13; | |
void setup() { | |
pinMode(ledPin, OUTPUT); // 设置13端口为输出 | |
} | |
void loop() { | |
digitalWrite(ledPin, HIGH); // 设13端口为高位,让灯亮起来 | |
delay(1000); // 等待1s | |
digitalWrite(ledPin, LOW); // 设为低位,让灯熄灭 | |
delay(1000); // 等待1s | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment