忍者ブログ

設備のマニアどっとこむ

IoT開発、設備・DIYのブログ!

arduinoでクリスマスイルミネーション

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);
   
  
}





拍手[0回]

PR

コメント

翻訳(Translate)

プロフィール

HN:
佐々木 雅史
性別:
男性
自己紹介:
2021年 ラズパイ、M5stackを用いたIoT開発を専門で受注するアルティメンテを設立。代表を務める。
・2020年ラズパイコンテスト優良賞受賞
・設備系資格多数(電験3種、消防設備士甲4、2級ボイラー技士、危険物乙4、電工2種、技術士補(電気・電子)、エネ電、フォークリフトなど)

AD

カレンダー

10 2024/11 12
S M T W T F S
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30