MAKE YOUR OWN NIGHT LIGHT

by linethan129 in Circuits > Art

199 Views, 0 Favorites, 0 Comments

MAKE YOUR OWN NIGHT LIGHT

WIN_20200415_12_10_41_Pro.jpg
WIN 20200415 12 11 22 Pro
WIN_20200415_12_10_41_Pro.jpg

This is an easy project :

from the original website: https://www.instructables.com/id/Arduino-Photores...

The part I have changed: I have change one led light into five of them, and also change the color of led light, and add a cover for my project.

我將一個led燈更改為五個led燈,還更改了led燈的顏色,並為我的作品添加了一個外殼。 並把主題改成夜燈

function:

只要把電燈關閉,夜燈便會自動發光,只要輸入程式碼,和麵包版圖即可。

to function it you have to turn off the light, and the night light will turn on auto .just have to insert the code and breadboard destruction.

the Material

Prepare those materials:

Photoresistor x1

Many wires

a breadboard

many led light

Leonardo Audino board

The Bread Board and the Code Also the Original Learning Website

WIN_20200415_16_27_42_Pro.jpg

這是放在麵包板上並像我的項目一樣隨意添加更多led燈的最基本方法。

代碼:

int Pr = 0;
int PrValue = 0;

int Pr_Input = 700; //改

無效設置(){

Serial.begin(500);

pinMode(8,輸出); pinMode(7,輸出); //改pinMode(6,OUTPUT); //改pinMode(5,OUTPUT); //改pinMode(4,OUTPUT); //改Serial.begin(500);+ Serial.print(模擬讀取(A0)); //打印消息Serial.print(“”); //打印一個空白的Serial.println();}

無效循環(){

PrValue = AnalogRead(Pr);

Serial.println(PrValue);

延遲(10);

如果(PrValue

}

這是我的代碼(程式碼網站)的連結https://create.arduino.cc/editor/ethan129/f201102c-f986-4f61-ba97-b34c604c9886/preview

我更改的部分:

我將一個led燈更改為五個,還更改了led燈的顏色,並為我的項目添加了一個封面。

我將一個led燈更改為五個led燈,還更改了led燈的顏色,並為我的作品添加了一個外殼。

並把主題改成夜燈