Cov txheej txheem:

Clap-activated LED Array: 4 Kauj Ruam
Clap-activated LED Array: 4 Kauj Ruam

Video: Clap-activated LED Array: 4 Kauj Ruam

Video: Clap-activated LED Array: 4 Kauj Ruam
Video: Whelen 8 Function Power Control Center 2024, Kaum ib hlis
Anonim
Qhib-qhib LED Array
Qhib-qhib LED Array

Txog qhov kawg ntawm cov lus qhia no koj yuav tuaj yeem tsim lub cuab yeej uas mloog lub suab nrov zoo li npuaj thiab teb rau lawv los ntawm kev qhib lossis tua 3 LEDs. Saum toj no yog daim duab ntawm qhov tshwm sim zaum kawg.

Kauj ruam 1: Cov ntaub ntawv

Koj yuav xav tau:

  1. Arduino Ib
  2. Breadboard (saib cov kauj ruam 3)
  3. 4 Txiv neej-Txiv neej Jumper Wires
  4. 3 Txiv neej-Poj Niam Jumper Hluav Taws Xob
  5. 3 LEDs
  6. 3 220 ohm resistors
  7. 1 KY-038 microphone suab sensor module

Koj tuaj yeem yuav cov khoom no online los ntawm ntau qhov chaw - tshawb nrhiav ib puag ncig thiab koj yuav tsum muaj peev xwm nrhiav tau cov no ntawm tus nqi tsim nyog.

Kauj ruam 2: Sib dhos

Los ua ke
Los ua ke

Hlau Arduino thiab nws cov khoom siv zoo li nws nyob hauv daim duab no. Cov xov hlau xiav thiab grey sawv cev rau txiv neej-txiv neej jumper cables thiab daj, dub thiab liab xov tooj sawv cev rau txiv neej-poj niam jumper cables.

Nco ntsoov tias koj tseem tuaj yeem ua kom haum rau hauv Circuit Court mus rau lub khob cij me me zoo li kuv tau ua hauv qib 1 duab. Kuv yuav tsis pom zoo nws li, vim nws yooj yim heev los sib xyaw lossis tawg yam thaum lawv tau ntim nruj ua ke.

Txij li thaum kuv nrhiav tsis tau ib feem rau KY-038, kuv yuav tsum tso nws tawm ntawm daim duab. Cov hlau daj yuav tsum txuas nrog nws tus pin "A0", cov xaim dub yuav tsum txuas nrog nws tus pin "G" (Hauv av), thiab cov xaim liab yuav tsum txuas nrog nws tus pin "+" (5V).

Kauj ruam 3: Code

Qhib Arduino IDE thiab muab cov lej hauv qab no tso rau hauv:

pastebin.com/cJQUA4eM

Hloov kab 1 txog 25 yog xav tau; Kuv tau ntxiv cov lus pom los piav qhia txog txhua tus neeg nyob ruaj khov ua dab tsi.

Tom qab koj tau muab tshuaj txhuam thiab hloov kho cov cai rau koj nyiam, xa nws mus rau Arduino.

Kauj ruam 4: Ua tiav

Yog tias txhua yam ua tau raws li phiaj xwm, koj yuav tsum muaj lub luag haujlwm ua haujlwm npuaj-ua haujlwm LED teeb. Nov yog cov npe ntawm cov lus txib hauv kuv tus lej tam sim no:

  • 2 npuaj: Toggles LED 1
  • 3 npuaj: Toggles LED 2
  • 4 npuaj: Toggles LED 3
  • 5 npuaj: Qhib tag nrho cov LEDs tawm
  • 6 npuaj: Qhib tag nrho cov LEDs rau
  • 16 npuaj: Qhia pom!: P

Yog tias koj muaj lub siab tawv txaus, koj tuaj yeem nkag mus rau kuv tus lej thiab ntxiv lossis hloov kho cov lus txib tam sim no los ua qhov sib txawv. Cov cai muaj feem nyob ntawm kab 84-148.

Muaj kev lom zem!

Pom zoo: