Cov txheej txheem:
- Kauj Ruam 1: Nqe lus piav qhia
- Kauj Ruam 2: Daim Ntawv Teev Npe
- Kauj Ruam 3: Daim Kab Xev
- Kauj ruam 4: Arduino Source Code
Video: Arduino Metronome: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Thaum kawm paub cov cuab yeej siv suab paj nruag tshiab thaum tseem yog menyuam yaus, muaj ntau yam tshiab uas yuav tsum tsom mus rau. Ua kom nrawm nrawm nrawm yog ib qho ntawm lawv. Tsis pom qhov ua kom tiav thiab yooj yim metronome txhais tau tias yog kev zam txim zoo tshaj plaws los pib tsim dua nrog kuv cov menyuam. Hauv Cov Lus Qhia no koj yuav pom cov lus piav qhia ua haujlwm, cov npe teev nrog webshop txuas thiab tus nqi, daim duab thaiv rau kev sib dhos, thiab ua tiav Arduino qhov chaws.
Kauj Ruam 1: Nqe lus piav qhia
Nws yuav yog qhov zoo kom muaj cov cuab yeej siv metronome nrog cov haujlwm hauv qab no los siv nws hauv tsev lossis hauv tsev kawm suab paj nruag yooj yim.
- Kev cog lus me me kom haum rau qhov chaw me me nyob rau sab saum toj lossis ib sab ntawm cov twj paj nruas,
- Roj teeb ua haujlwm, muaj zog thiab nqa tau mus ib puag ncig,
- Yooj yim teeb tsa txawm tias rau menyuam yaus, BPM tus nqi ib txwm tso tawm,
- Hloov kho cov neeg ntaus ib feeb nrog lub pob qhov rooj, nce txog 240 BPM
- Lub ntsej muag hnov nrog tswj lub ntim,
- Hom uas ntsiag to rau kev xyaum mloog lub mloog pob ntseg,
- Pom kev tawm tswv yim ntawm cov neeg ntaus (1/4, 2/4, 3/3, 4/4, 6/8, thiab lwm yam) txog 8 LEDs,
- Nrog lossis tsis muaj tus hais lus tseem ceeb, nrog kev pom thiab hnov suab.
Hloov mus, hom metronome yuav pib ntawm 60 BPM qhia ntawm lub vijtsam me me thiab cia qhov nrawm nrawm los ntawm lub pob qhov rooj ntawm 10 thiab 240. Neopixels qhia qhov ntaus hauv xiav LEDs thaum lub suab nrov zuam. Nias lub pob qhov rooj yuav hloov mus rau txoj kev hloov kho thiab LEDs ntsuab yuav qhia qhov teeb tsa kev teeb tsa. Teb pob qhov rooj yuav nce lossis txo qhov kev sib tw (2/2, 3/3, 4/4, 6/8, thiab lwm yam). Saum 8 LEDs, txuas ntxiv raws lub moos raws, cov lus hais ua ntej yuav qhib, thiab thawj LED yuav qhia qhov no liab. Ua tus hais lus tseem ceeb yuav muaj lub suab tawm tswv yim ib yam. Nws tuaj yeem raug tua los ntawm kev tig rov qab-clockwise. Nias lub pob qhov rooj yuav hloov rov qab los ntawm kev hloov kho hom mus rau hom metronome.
Kauj Ruam 2: Daim Ntawv Teev Npe
Koj yuav xav tau ib rooj plaub. Ib qho duab lossis qhov loj tuaj yeem yuav tau, tab sis peb muaj cov ntaub ntawv dub hlau zoo ntawm phau ntawv qub VGA hloov pauv ntawm tus phooj ywg. Cov seem ntawm cov seem tau teev tseg hauv qab no.
- 9V Roj Teeb, USD 1.50
- Roj teeb txuas cable, USD 0, 16
- Arduino Nano nrog tus pin headers, USD 2.05
- Nano IO Extension Shield, USD 1, 05
- Mini swb hloov rau lub zog, USD 0.15
- Piezo buzzer, USD 0, 86
- Adafruit Neopixel WS2812 8-ntsis, USD 1, 01
- OLED Zaub 128x64, USD 1, 53
- Teb encoder, USD 0, 50
- Dupont cables F/F, USD 0, 49
Tag nrho tus nqi ntawm cov khoom siv tsawg dua USD 10, -
Kauj Ruam 3: Daim Kab Xev
Siv Nano IO Extension Board txhawm rau kom tsis txhob cuam tshuam nrog ntau qhov sib txuas GND thiab VCC. Qhov tsawg kawg yuav tsum tau siv rau Nano tus pin headers thiab rau Neopixel module txuas. Kev siv Dupont cov xov hlau tso cai rau kev sib txuas ruaj khov rau seem ntawm cov thaiv raws li qhia hauv daim duab. Lub roj teeb 9V txuas nrog GND thiab VIN, tom kawg los ntawm kev hloov lub zog hluav taws xob. Cov qauv encoder teb tau muaj khawm hloov ua ke, uas tau qhia cais hauv daim duab kom nkag siab yooj yim ntawm kev txuas lawv li cas. Ib feem teb (CLK thiab DT) txuas nrog PIN2 thiab PIN3 feem, vim tias cov no tsuas yog NANO tus pin muaj peev xwm cuam tshuam kev tuav. Teb GND txuas nrog Nano's GND PIN ntawm chav kawm. Lub khawm hloov ua ke tau txuas nrog PIN4. Piezo buzzer txuas nrog PIN5 thiab GND. Adafruit Neopixel module txuas nrog PIN7 thiab nws VIN thiab GND rau Nano's 5V thiab GND feem. OLED me me tau txuas nrog I2C npav npav, uas yog PIN A4 thiab A5 rau SDA thiab SDL. VCC thiab GND mus rau Nano's 5V thiab GND tau kawg. Qhov ntawd xaus peb Dupont thaiv.
Kauj ruam 4: Arduino Source Code
// Metronome, Leading Accent, Visual & Audible Tact - 2019 Peter Csurgay
#include #include #include #include #include "TimerOne.h" #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 #define OLED_RESET -1 // Reset pin #(lossis -1 yog sib koom Arduino reset pin) Adafruit_SSD1306 zaub (SCREEN_WIDTH, & Hlau, OLED_RESET); #define pin_neopixel 7 #define NUMPIXELS 8 #define BRIGHTNESS 32 Adafruit_NeoPixel pixels = Adafruit_NeoPixel (NUMPIXELS, pin_neopixel, NEO_GRB + NEO_KHZ800); #define IDLE_11 0 #define SCLK_01 1 #define SCLK_00 2 #define SCLK_10 3 #define SDT_10 4 #define SDT_00 5 #define SDT_01 6 int xeev = IDLE_11; #define CLK 2 #define DT 3 #define pin_switch 4 #define pin_buzzer 5 int bpm = 60; int bpmFirst = 0; // LED Thaum xub thawj, Tawm ntawm tus so… int tack = 4; bool leadingTack = tsis tseeb; int pos = 0; int curVal = 0; int prevVal = 0; teeb tsa tsis muaj dab tsi () {pixels.begin (); pinMode (tus pin_buzzer, OUTPUT); Timer1.initialize (1000000*60/bpm/2); Timer1.attachInterrupt (buzztick); pinMode (CLK, INPUT_PULLUP); pinMode (DT, INPUT_PULLUP); pinMode (pin_switch, INPUT_PULLUP); attachInterrupt (digitalPinToInterrupt (CLK), rotaryCLK, CHANGE); attachInterrupt (digitalPinToInterrupt (DT), rotaryDT, CHANGE); yog (! display.begin (SSD1306_SWITCHCAPVCC, 0x3C)) {// Chaw Nyob 0x3D rau 128x64 rau (;;); // Tsis txhob ua ntxiv, voj mus ib txhis} display.clearDisplay (); display.display (); } void loop () {if (digitalRead (pin_switch) == LOW) {ncua (100); thaum (digitalRead (pin_switch) == QAU); ncua (100); Timer1.detachInterrupt (); showGreenTacks (); thaum (digitalRead (pin_switch) == HIGH) {yog (curVal> prevVal) {tack+= 1; yog (tack> 8) {yog (leadingTack) tack = 8; lwm tus {leadingTack = muaj tseeb; tug = 1; }}} lwm tus yog (curValprevVal) {bpm+= 2; yog (bpm> 240) bpm = 240; } lwm tus yog (curVal = 100) display.print (""); lwm tus display.print (""); display.print (bpm); display.display (); } tsis muaj dabtsis buzztick () {yog (bpmFirst == 0) {int ntim = 4; yog (leadingTack && pos == 0) ntim = 8; rau (int i = 0; i
Pom zoo:
Servo Metronome, Programmable rau Sib Txawv Sib Txawv: 3 Cov Kauj Ruam
Servo Metronome, Programmable rau Sib Txawv Sib Txawv: Ua koj tus kheej metronome. Txhua yam koj xav tau yog Arduino Mega 2560 cov khoom pib thiab lub khoos phis tawj sib xws
555-timer Metronome: 3 Kauj Ruam
555-timer Metronome: Lub metronome yog lub cuab yeej uas ua rau hnov lub suab lossis lwm yam suab ntawm ntu ntu uas tuaj yeem teeb tsa los ntawm tus neeg siv, feem ntau yog ntaus ib feeb (BPM). Cov kws hu nkauj siv lub cuab yeej los xyaum ua si kom ua haujlwm li qub. (Https://en.wikipedia.org/w
Micro-controller Raws Metronome: 5 Cov Kauj Ruam
Micro-controller Raws Metronome: Lub ntsuas cua yog lub cuab yeej siv sijhawm los ntawm cov kws ntaus nkauj kom taug qab cov neeg ntaus nkauj thiab txhim kho kev nkag siab ntawm lub sijhawm ntawm cov pib kawm uas tab tom kawm ntaus nkauj tshiab. Nws pab tswj kom muaj kev nkag siab ntawm lub suab uas yog qhov tseem ceeb hauv suab paj nruag.Qhov metronome bui
Visual Metronome rau Drummers: 8 Kauj Ruam
Visual Metronome rau Drummers: Kuv muaj phooj ywg thiab phooj ywg ua haujlwm uas yog pob zeb thiab yob nruas. Nws lub cubicle nyob ib sab ntawm kuv ntawm kev ua haujlwm thiab yog li nws pom thiab hnov txog txhua yam ntawm kuv cov khoom siv hluav taws xob thiab software. Nws tau ntau dua ib xyoos yog li kuv tsis tuaj yeem nco qab tias txhua qhov no tshwm sim li cas
555 Timer Metronome - Suab & Pom Duab: 8 Kauj Ruam (nrog Duab)
555 Timer Metronome - Suab & Visual: Kuv tus tub nyuam qhuav pib ua si ukulele thiab kuv xav tias lub metronome yuav pab nws lub sijhawm. Raws li tus tsim khoom, kuv xav tias kuv tuaj yeem nplawm ib qho rau kuv tus kheej tau yooj yim nrog 555 lub sijhawm (dab tsi koj tsis tuaj yeem ua nrog ib qho …) Tom qab tshawb me ntsis ntawm w