Cov txheej txheem:

Yooj Yim Music Player Nrog Buzzer: 4 Kauj Ruam
Yooj Yim Music Player Nrog Buzzer: 4 Kauj Ruam

Video: Yooj Yim Music Player Nrog Buzzer: 4 Kauj Ruam

Video: Yooj Yim Music Player Nrog Buzzer: 4 Kauj Ruam
Video: Cody Lee - Nyob Ib Sab Ntuj Performance 2019 2024, Kaum ib hlis
Anonim
Yooj Yim Music Player Nrog Buzzer
Yooj Yim Music Player Nrog Buzzer

Nov yog txoj haujlwm yooj yim uas yuav tso cai rau koj ua suab paj nruag ntawm koj lub arduino siv lub suab nrov thiab qee cov LEDs. Nyob ntawm qhov ntau zaus, qhov sib txawv LED yuav ci.

Rau qhov no, koj yuav xav tau:

  • koj arduino uno
  • daim ntawv qhia zaub mov
  • 4 resistors
  • buzzer
  • 3 LEDs
  • khawm
  • qee cov xov hlau txuas

Kauj ruam 1: Ntxiv Khawm

Ntxiv khawm
Ntxiv khawm

Kauj ruam 2: Khawm thiab Buzzer

Khawm thiab Buzzer
Khawm thiab Buzzer

Txuas koj lub buzzer rau lub khob cij nrog ib txoj hlua txuas rau GND kev tsheb nqaj hlau thiab lwm qhov txuas rau ib tus pin ntawm koj Arduino (13, hauv qhov no).

Koj lub pob yuav tsum txuas nrog hauv av siv tus tiv thaiv, mus rau txoj kab hluav taws xob, thiab tom qab ntawd mus rau tus pin ntawm Arduino (qhov no, tus pin 8).

Kauj Ruam 3: Ntxiv LEDs

Ntxiv LEDs
Ntxiv LEDs

Ntxiv koj peb LEDs rau ntawm lub khob cij, txuas qhov ntev kawg ntawm txhua tus rau arduino pins siv cov resistors. Cov coj luv yuav txuas nrog GND txoj kev tsheb nqaj hlau.

Nco ntsoov txuas txoj hlua hluav taws xob thiab tsheb nqaj hlau GND mus rau 5v thiab GND pins ntawm koj lub arduino.

Kauj ruam 4: Code

Txoj cai tau txais kev tshoov siab ntau thiab ua ke ua ke siv peb lub ntsiab lus tseem ceeb

qhov no Arduino suab paj nruag qhia txog lub rooj sib tham no hais txog kev sib txuas LEDs nrog lub teeb pom kev no cov ntawv nrog cov ntawv xav tau los ua si nkauj Christmas.

Txawm hais tias nws tsis ua haujlwm raws li qhov kuv tau npaj ua ntej, nws ua nkauj thaum lub pob nyem. Lub hom phiaj yog ua cov nkauj sib txawv nyob ntawm seb muaj pes tsawg lub sijhawm khawm tau nyem (yog li lub txee hauv tus lej), tab sis kuv tseem ntsib teeb meem nrog tso cov ntawv thiab ntaus sab hauv yog-nqe lus. Thaum nws yuav suav ua ke, lub suab nrov tsuas yog ua rau lub suab nrov thiab LED liab yuav nyem, ploj tab sis nrawm, kom txog thaum zaj nkauj dhau mus.

Pom zoo: