Skip to content

Instantly share code, notes, and snippets.

@ghostoy
Created May 21, 2019 09:31
Show Gist options
  • Save ghostoy/fd2876eb16fe4c2109631dc661c7ba35 to your computer and use it in GitHub Desktop.
Save ghostoy/fd2876eb16fe4c2109631dc661c7ba35 to your computer and use it in GitHub Desktop.
Arduino点亮LED灯
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