Arduino Smart Car-LED (20180504 Training Course--Huaqing Vision)
Others
2022-04-27 11:28:54
views: 0
1. Arduino LED hardware connection
- Arduino has a programmable LED light, the corresponding pin number is 13 , please refer to the hardware schematic diagram for details.
2. Arduino LED programming
- step 1: Set pin 13 as output function, the specific programming is as follows:
#define LED_PIN 13
void setup() {
// put your setup code here, to run once:
pinMode(LED_PIN,OUTPUT); //设置引脚 13 为输出功能
}
- step 2 : Add the following code to the loop function:
digitalWrite(LED_PIN,HIGH);//输出高电平,则LED灯亮
delay(1000);
digitalWrite(LED_PIN,LOW);//输出低电平,则LED灯灭
delay(1000);
Origin http://43.154.161.224:23101/article/api/json?id=325561601&siteId=291194637