Cov txheej txheem:

Qauv Litwick: 6 Kauj Ruam
Qauv Litwick: 6 Kauj Ruam

Video: Qauv Litwick: 6 Kauj Ruam

Video: Qauv Litwick: 6 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Kaum ib hlis
Anonim
Image
Image

Siv LED thiab Arduino los tsim lub thawv zaub.

Kuv siv Txoj Cai Kev Ua pa kom tsim lub LED nyob hauv tus qauv, nws tuaj yeem qhia qee yam zoo li lub xeev ntawm tswm ciab lub teeb.

Kauj Ruam 1: Khoom

Sib sau Ua Zoo
Sib sau Ua Zoo

Npaj yam koj xav tau.

1. Arduino Uno x1

2. Coj x1

3. Kuj x1

4. Hlau jumper x2

Kauj Ruam 2: Sib Sau Ua Zoo

Siv lub jumper txuas koj Arduino board thiab Breadboard.

Ua ntej tshaj, koj yuav tsum nrhiav qhov zoo los tawm tswv yim hluav taws xob hauv koj lub teeb ci LED.

Kuv siv "5v" los tso hluav taws xob hauv lub khob cij thiab txuas mus rau tus pin zoo ntawm LED. (tus pin ntev tshaj yog tus pin zoo)

Kauj Ruam 3: Sib Sau Tsis Zoo

Sib Sau Tsis Zoo
Sib Sau Tsis Zoo

Tom ntej no, peb yuav tsum txuas tus pin tsis zoo rau Arduino board.

Ua ntej peb siv lub jumper txuas rau tus pin tsis zoo ntawm LED, tsis txhob hnov qab siv kev tiv thaiv.

Peb yuav tsum siv kev tiv thaiv vim tias nws yog lub luag haujlwm ntawm tus tiv thaiv yog ua kom cov hluav taws xob hluav taws xob ua haujlwm tau yooj yim los ntawm kev txwv cov dej ntws tam sim no.

Tom qab peb ntxiv rau ntawm lub khob cij thiab txuas ib tus pin ntawm LED tus lej tsis zoo, koj yuav tsum siv lub jumper txuas "GND" ntawm koj lub rooj tsav xwm Arduino.

Kauj ruam 4: Nkag mus rau Txoj Cai

int coj = 9; // tus pin uas LED txuas rau

qhov Brightness = 0; // ci li cas int Fade = 5; // pes tsawg lub ntsiab lus kom ploj qhov tsis muaj teeb tsa () {pinMode (coj, OUTPUT); } void loop () {analogWrite (coj, Brightness); Brightness = Brightness + Fade; yog (Brightness == 0 || Brightness == 255) {Fade = -Fade; } ncua (35); // ntev npaum li cas nws ploj thiab ci}

Kauj ruam 5: Kho kom zoo nkauj

Kho kom zoo nkauj
Kho kom zoo nkauj

Kuv siv cov ntaub tsis-woven, styrofoam, ntawv dawb, txiab, kab xev, thiab lub thawv ntaub so ntswg los ua kom zoo nkauj.

Pom zoo: