aruduinoでクリスマスイルミネーションを作りました。
↓↓ソースはこちら↓↓
#define LED_PIN 14
#define LED_PIN2 15
#define LED_PIN3 16
#define LED_PIN4 17
#define LED_PIN5 18
#define LED_PIN6 19
void setup() {
pinMode(LED_PIN, OUTPUT);
pinMode(LED_PIN2, OUTPUT);
pinMode(LED_PIN3, OUTPUT);
pinMode(LED_PIN4, OUTPUT);
pinMode(LED_PIN5, OUTPUT); pinMode(LED_PIN6, OUTPUT);
}
void loop() {
digitalWrite(LED_PIN, HIGH);
delay(3000);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, HIGH);
delay(3000);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, HIGH);
delay(3000);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, HIGH);
delay(3000);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, HIGH);
delay(100);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN5, HIGH);
delay(100);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN5, HIGH);
delay(100);
digitalWrite(LED_PIN5, LOW);
delay(100);
digitalWrite(LED_PIN5, HIGH);
delay(100);
digitalWrite(LED_PIN5, LOW);
delay(100);
digitalWrite(LED_PIN5, HIGH);
delay(100);
digitalWrite(LED_PIN5, LOW);
delay(100);
digitalWrite(LED_PIN5, HIGH);
delay(100);
digitalWrite(LED_PIN5, LOW);
delay(100);digitalWrite(LED_PIN5, HIGH);
delay(100);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, HIGH);
delay(1000);
digitalWrite(LED_PIN5, HIGH);
delay(1000);
digitalWrite(LED_PIN4, HIGH);
delay(1000);
digitalWrite(LED_PIN3, HIGH);
delay(1000);
digitalWrite(LED_PIN2, HIGH);
delay(1000);
digitalWrite(LED_PIN, HIGH);
delay(1000);
digitalWrite(LED_PIN6, LOW);
delay(1000);
digitalWrite(LED_PIN5, LOW);
delay(1000);
digitalWrite(LED_PIN4, LOW);
delay(1000);
digitalWrite(LED_PIN3, LOW);
delay(1000);
digitalWrite(LED_PIN2, LOW);
delay(1000);
digitalWrite(LED_PIN, LOW);
delay(1000);
digitalWrite(LED_PIN, HIGH);
delay(800);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, HIGH);
delay(800);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, HIGH);
delay(800);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, HIGH);
delay(800);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, HIGH);
delay(800);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, HIGH);
delay(800);
digitalWrite(LED_PIN6, LOW);
digitalWrite(LED_PIN5, HIGH);
delay(800);
digitalWrite(LED_PIN5, LOW);
delay(800);
digitalWrite(LED_PIN4, HIGH);
delay(800);
digitalWrite(LED_PIN4, LOW);
delay(800);
digitalWrite(LED_PIN3, HIGH);
delay(800);
digitalWrite(LED_PIN3, LOW);
delay(800);
digitalWrite(LED_PIN2, HIGH);
delay(800);
digitalWrite(LED_PIN2, LOW);
delay(800);digitalWrite(LED_PIN, HIGH);
delay(800);
digitalWrite(LED_PIN, LOW);
delay(2000);
digitalWrite(LED_PIN, HIGH);
digitalWrite(LED_PIN2, HIGH);
digitalWrite(LED_PIN3, HIGH);
digitalWrite(LED_PIN4, HIGH);
digitalWrite(LED_PIN5, HIGH);
digitalWrite(LED_PIN6, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, LOW);
delay(100);
digitalWrite(LED_PIN, HIGH);
digitalWrite(LED_PIN2, HIGH);
digitalWrite(LED_PIN3, HIGH);
digitalWrite(LED_PIN4, HIGH);
digitalWrite(LED_PIN5, HIGH);digitalWrite(LED_PIN6, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, LOW);
delay(100); digitalWrite(LED_PIN, HIGH);
digitalWrite(LED_PIN2, HIGH);
digitalWrite(LED_PIN3, HIGH);
digitalWrite(LED_PIN4, HIGH);
digitalWrite(LED_PIN5, HIGH);digitalWrite(LED_PIN6, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, LOW);
delay(100); digitalWrite(LED_PIN, HIGH);
digitalWrite(LED_PIN2, HIGH);
digitalWrite(LED_PIN3, HIGH);
digitalWrite(LED_PIN4, HIGH);
digitalWrite(LED_PIN5, HIGH);digitalWrite(LED_PIN6, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, LOW);
delay(100); digitalWrite(LED_PIN, HIGH);
digitalWrite(LED_PIN2, HIGH);
digitalWrite(LED_PIN3, HIGH);
digitalWrite(LED_PIN4, HIGH);
digitalWrite(LED_PIN5, HIGH);digitalWrite(LED_PIN6, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, LOW);
delay(100); digitalWrite(LED_PIN, HIGH);
digitalWrite(LED_PIN2, HIGH);
digitalWrite(LED_PIN3, HIGH);
digitalWrite(LED_PIN4, HIGH);
digitalWrite(LED_PIN5, HIGH);digitalWrite(LED_PIN6, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, LOW);
delay(100); digitalWrite(LED_PIN, HIGH);
digitalWrite(LED_PIN2, HIGH);
digitalWrite(LED_PIN3, HIGH);
digitalWrite(LED_PIN4, HIGH);
digitalWrite(LED_PIN5, HIGH);digitalWrite(LED_PIN6, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, LOW);
delay(100); digitalWrite(LED_PIN, HIGH);
digitalWrite(LED_PIN2, HIGH);
digitalWrite(LED_PIN3, HIGH);
digitalWrite(LED_PIN4, HIGH);
digitalWrite(LED_PIN5, HIGH);digitalWrite(LED_PIN6, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, LOW);
delay(100); digitalWrite(LED_PIN, HIGH);
digitalWrite(LED_PIN2, HIGH);
digitalWrite(LED_PIN3, HIGH);
digitalWrite(LED_PIN4, HIGH);
digitalWrite(LED_PIN5, HIGH);digitalWrite(LED_PIN6, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, LOW);
delay(100); digitalWrite(LED_PIN, HIGH);
digitalWrite(LED_PIN2, HIGH);
digitalWrite(LED_PIN3, HIGH);
digitalWrite(LED_PIN4, HIGH);
digitalWrite(LED_PIN5, HIGH);digitalWrite(LED_PIN6, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, LOW);
delay(100); digitalWrite(LED_PIN, HIGH);
digitalWrite(LED_PIN2, HIGH);
digitalWrite(LED_PIN3, HIGH);
digitalWrite(LED_PIN4, HIGH);
digitalWrite(LED_PIN5, HIGH);digitalWrite(LED_PIN6, HIGH);
delay(100);
digitalWrite(LED_PIN, LOW);
digitalWrite(LED_PIN2, LOW);
digitalWrite(LED_PIN3, LOW);
digitalWrite(LED_PIN4, LOW);
digitalWrite(LED_PIN5, LOW);
digitalWrite(LED_PIN6, LOW);
delay(1000);
}