arduino代码整理
文章目录
- 1.blink 和串口输出
1.blink 和串口输出
#define PIN 4 //定义了led灯的GPIO为4
void setup() {pinMode(PIN, OUTPUT);Serial.begin(9600);
}
void loop() {digitalWrite(PIN, HIGH); // turn the LED on (HIGH is the voltage level)delay(1000); Serial.print("1"); // wait for a seconddigitalWrite(PIN, LOW); // turn the LED off by making the voltage LOWdelay(1000); Serial.println("0"); // wait for a second
}
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
