hahaya 发表于 2021-9-1 10:55:50

Anduino第一个led实验求指点


int led =13;

void setup() {
// put your setup code here, to run once:
    pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
    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);
}
但是这样变异上传后灯不亮 求指导啥原因。

赵AA 发表于 2021-9-3 08:59:37

int led =13;

void setup() {
  // put your setup code here, to run once:
    pinMode(led, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
    digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);  
}

msold5 发表于 2021-9-1 19:09:08

目测没接通

hahaya 发表于 2021-9-3 16:33:12

msold5 发表于 2021-9-1 19:09
目测没接通

哪个位置接线有问题呀?

kpj001 发表于 2021-10-2 18:33:16

int led =13;
pinMode(LED_BUILTIN, OUTPUT);
问题出在这两句, 引脚指定用的变量名 led , 函数里用的 LED_BUILTIN 。 楼上已经有人帮你改好了,不去试试?

还有就这个实验而言,直接插UNO上就行了,不用面包板和电阻,放心烧不了的。至于为什么,本论坛实验摸爬滚打搞几十个自然明白了
页: [1]
查看完整版本: Anduino第一个led实验求指点