Arduino Night Light

Introduction: Arduino Night Light

this is a very thing to do. You can use it as a tool to help you lights up at night.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Material

材料:

盒子

led燈

傳輸線

220歐姆

連接線

麵包版

用具:

繪畫用具

剪刀

黏貼用具

Step 2: Circuit

just use three LED and three ome and also three lines to connect.

Step 3: Program

int yellow = 9;

int green = 8;

void setup() {

pinMode(red, OUTPUT);

pinMode(yellow, OUTPUT);

pinMode(green, OUTPUT);

}

void loop(){

changeLights();

delay(5000);

}

void changeLights(){

// green off, yellow on for 3 seconds //

digitalWrite(green, LOW);

digitalWrite(yellow, HIGH);

delay(3000);

// turn off yellow, then turn red on for 5 seconds //

digitalWrite(yellow, LOW);

digitalWrite(red, HIGH);

delay(5000);

// red and yellow on for 5 seconds (red is already on though)

digitalWrite(yellow, HIGH);

delay(2000);

// turn off red and yellow, then turn on all digitalWrite(yellow, HIGH);

digitalWrite(red, HIGH);

digitalWrite(green, HIGH);

delay(3000); }

Step 4: 外觀

分別有兩個重點

一個是要開洞給燈

第二是要開洞讓傳輸線可以穿過去

Step 5: 美化

可以再箱子上用你喜歡的繪畫用具幫你的箱子做裝飾,畫上你喜歡的圖案,使他看起來更美觀一點

Step 6: 成品

這樣就完成了,這個作品是很簡單的,就算你是初學者也可以試著做做看

Be the First to Share

    Recommendations

    • Magnets Challenge

      Magnets Challenge
    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest

    Discussions