LED 6개 순차 깜빡
2020. 5. 3. 20:53
Programing/Arduino
#define DELAY_TIME 100
void setup() {
// put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(2, HIGH);
delay(DELAY_TIME);
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
delay(DELAY_TIME);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
delay(DELAY_TIME);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
delay(DELAY_TIME);
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
delay(DELAY_TIME);
digitalWrite(6, LOW);
}
'Programing > Arduino' 카테고리의 다른 글
6FND, 초음파, 서보모터, Buzzer,매트릭스 키패드 (0) | 2020.05.27 |
---|---|
6digit FND (0) | 2020.05.25 |
LED,가변저항,버튼 제어 (0) | 2020.05.05 |