Cov txheej txheem:

Piano Suab Siv Arduino ntawm TinkerCad: 4 Cov Kauj Ruam
Piano Suab Siv Arduino ntawm TinkerCad: 4 Cov Kauj Ruam

Video: Piano Suab Siv Arduino ntawm TinkerCad: 4 Cov Kauj Ruam

Video: Piano Suab Siv Arduino ntawm TinkerCad: 4 Cov Kauj Ruam
Video: 叉雞露臉影片流出 2024, Kaum ib hlis
Anonim
Piano Suab Siv Arduino ntawm TinkerCad
Piano Suab Siv Arduino ntawm TinkerCad

Hauv qhov kev qhia no, koj yuav kawm paub siv buzzer (lossis hais lus piezo) nrog Arduino. Buzzers tuaj yeem pom hauv lub tswb nrov, khoos phis tawj, timers thiab kev lees paub ntawm cov neeg siv nkag mus xws li nias nas lossis keystroke. Siv txoj haujlwm no koj tuaj yeem ua suab piano. Yog li cia pib.

Kauj Ruam 1: Yam Koj Yuav Tsum Xav Tau - Kho vajtse

Yam Koj Yuav Tsum Xav Tau - Kho Vajtse
Yam Koj Yuav Tsum Xav Tau - Kho Vajtse
Yam Koj Yuav Tsum Xav Tau - Kho Vajtse
Yam Koj Yuav Tsum Xav Tau - Kho Vajtse
Yam Koj Yuav Tsum Xav Tau - Kho Vajtse
Yam Koj Yuav Tsum Xav Tau - Kho Vajtse

Rau qhov kev qhia no koj yuav xav tau:

1. Arduino UNO lossis nano

2. Buzzer/piezo hais lus

3. Breadboard (yog tias koj tab tom ua qhov project hauv lub sijhawm tiag tiag)

Kauj ruam 2: Circuit Court

Circuit Court
Circuit Court

Lub Circuit Court yog qhov yooj yim heev koj txhawm rau txuas tus lej tsis zoo ntawm lub buzzer mus rau gnd ntawm Arduino thiab tus lej zoo ntawm tus buzzer rau tus lej digital 8

Kauj Ruam 3: Txoj Cai

Yog xav paub ntau cov phiaj xwm txuas nrog kuv ntawm: Youtube:

Facebook nplooj ntawv:

Instagram: https://instagram.com/official_techeor? Igshid = uc8l…

Ntawm no yog "Tone" code. Nws ua haujlwm li cas? Nws yog qhov yooj yim, lub suab nrov (buzzer, 1000) xa 1KHz lub teeb liab mus rau tus pin 9, ncua (1000) ncua lub program rau ib pliag thiab tsis muajTone (buzzer) nres lub teeb liab. Lub voj () niaj hnub yuav ua qhov no, rov ua dua, ua suab nrov luv luv. (koj tseem tuaj yeem siv lub suab (tus lej, zaus, sijhawm) ua haujlwm)

int buzzer = 8;

void teeb () {// Txhais Buzzer tus pin li tso zis pinMode (buzzer, OUTPUT); } tsis muaj dab tsi voj () {suab (buzzer, 261); ncua (200); // Tig lub buzzer tawm noTone (buzzer); suab nrov (buzzer, 293); ncua (200); noTone (buzzer); suab nrov (buzzer, 329); ncua (200); noTone (buzzer); suab nrov (buzzer, 349); ncua (200); suab (buzzer, 201); ncua (200); // Tig lub buzzer tawm noTone (buzzer); suab nrov (buzzer, 283); ncua (200); noTone (buzzer); suab nrov (buzzer, 502); ncua (200); noTone (buzzer); suab nrov (buzzer, 149); ncua (200); }

Kauj ruam 4: Ua tau zoo

Koj tau ua tiav ib qho ntxiv Arduino "Yuav ua li cas" qhia thiab koj kawm paub siv: buzzer / piezo speakertone (), noTone () ua haujlwm

Pom zoo: