flashing LED lamp arduino

Hello everyone I'm your friend JamesBin, this text allows you to learn from arduino 0 and 1, let's start learning!

Hardware
Here Insert Picture Description
Source: Arduino-UNO-LED

Specifically includes the following:

Arduino UNO circuit board (1)
Mini breadboard (1)
220 ohm resistor (1)
the LED lamp (1)
Bread line (2)

Software only official Arduino IDE can be provided.
When you are ready to the above, as long as the next circuit connected, knocking a few simple lines of code, you can let the lamp flashes up!
Connecting circuit
Here Insert Picture Description

int led = 13;  // 定义针脚号,数字类型为整型


void setup() {

  pinMode(led, OUTPUT);
}
// 系统调用,无限循环方法
void loop() {

  digitalWrite(led, HIGH);

  delay(1000);
  // 此处向Arduino的13针脚发送低电压状态,
  // 此状态可以让LED神灯熄灭
  digitalWrite(led, LOW);
  // 再次延迟1000毫秒,也即1秒钟,
  delay(1000);

}

Here Insert Picture Description

Published 111 original articles · won praise 177 · views 210 000 +

Guess you like

Origin blog.csdn.net/qq_45172832/article/details/105156041