忍者ブログ

設備のマニアどっとこむ

設備、電子工作、DIYのブログ!

12/10

Sat

2016

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

Comment

お名前
タイトル
E-MAIL
URL
コメント
パスワード

AD

シェアしてね

プロフィール

HN:
アルティメット雅史
性別:
男性
自己紹介:
製油所、データセンター、化学工場を渡り歩いた設備のマニア
最近はarduinoあたりの電子工作にハマる。
取得資格は電験3種、消防設備士甲4、2級ボイラー技士、危険物乙4、電工2種、技術士一次試験合格(電気・電子)、エネ電合格、フォークリフトほか

カウンター

お問い合わせ

忍者アクセスランキング

Copyright © 設備のマニアどっとこむ : All rights reserved

TemplateDesign by KARMA7

忍者ブログ [PR]