[問題] 請問一下這份程式碼

作者: yimean (溫柔殺手)   2018-05-24 20:51:43
各位版上的大大晚上好
我正在研讀Arduino的入門範例LED閃爍。
void setup() {
// initialize digital pin LED_BUILTIN 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
}
請問他怎麼知道我的LED_UBUILTIN是第13隻腳?
我編譯後還真的可以用。
我們一般都會指定變數像是#define LED_BUILTIN 13
但這份程式碼沒有,而且可以正常的Work說。太神奇了。
作者: dennisxkimo (Dennis(一上B就糟糕))   2018-05-25 14:44:00
arduino constant
作者: dsplab (星野夢美)   2018-05-26 07:56:00

Links booklink

Contact Us: admin [ a t ] ucptt.com