Cov txheej txheem:

Hlawv LED: 4 Kauj Ruam
Hlawv LED: 4 Kauj Ruam

Video: Hlawv LED: 4 Kauj Ruam

Video: Hlawv LED: 4 Kauj Ruam
Video: Plab Plab Ntswg..(Pluav Pluav Ntswg) Maiv Twm New Song 2023-2024 2024, Kaum ib hlis
Anonim
Hlawv LED
Hlawv LED

nyob zoo cov neeg! lub sijhawm no kuv xav qhia qhov tshwm sim ntawm kuv qhov project, piv txwv li coj kev siv zog. coj kev siv yog ib qho xwm txheej uas qhov kev siv ntawm LED hloov pauv txhua 200 milliseconds. ua tus nqi ntawm LEDs sib txawv kom cov LEDs zoo li cov khoom hlawv. Tsis tau tos ntev, cia saib yuav ua li cas sib sau ua ke.

Kauj Ruam 1: Kauj Ruam 1: Cov Ntaub Ntawv Xav Tau

Kauj Ruam 1: Cov Ntaub Ntawv Xav Tau
Kauj Ruam 1: Cov Ntaub Ntawv Xav Tau
  1. 1 x 9V pin
  2. 1 x Arduino UNO
  3. 4x LED ua
  4. 1x Ib nrab khob cij
  5. 2x jumper xov
  6. 1 x Lub roj teeb nrog lub hwj chim txuas
  7. 1x USB hom A rau hom B.

Kauj Ruam 2: Kauj Ruam 2: Txhim Kho Cov Txheej Txheem

Kauj Ruam 2: Txhim Kho Cov Txheej Txheem
Kauj Ruam 2: Txhim Kho Cov Txheej Txheem

npaj cov khoom koj muab. tsis txhob tso lub polarity (cathode-anode) tsis yog. Vim tias nws tuaj yeem ua rau txoj haujlwm no ua tsis tiav. Node rau digital 5. Cathode rau GND.

Kauj Ruam 3: Kauj Ruam 3: Txoj Cai

Kauj ruam 3: Code
Kauj ruam 3: Code

txoj haujlwm no yog nyob ntawm qhov chaws tau muab. Nov yog cov cai uas yuav tsum tau xa mus rau Arduino:

const int PIN_LED = 5; // Pin PWM

void teeb tsa () {

tus pinMode (PIN_LED, OUTPUT); }

void voj () {

int nilaiAcak = random (176);

analogWrite (PIN_LED, 60 + nilaiAcak);

ncua (200); }

Kauj Ruam 4: Kauj Ruam 4: Nws Ua Haujlwm

Kauj ruam 4: Nws Ua Haujlwm!
Kauj ruam 4: Nws Ua Haujlwm!

Txoj haujlwm no yuav tsum ua tiav. Yog tias nws tsis ua haujlwm, tej zaum koj tsis ceev faj txaus. Saib ntawm Circuit lossis code.

Pom zoo: