Cov txheej txheem:

LoL Shield Audio Spectrum VU Meter: 4 Kauj Ruam (nrog Duab)
LoL Shield Audio Spectrum VU Meter: 4 Kauj Ruam (nrog Duab)

Video: LoL Shield Audio Spectrum VU Meter: 4 Kauj Ruam (nrog Duab)

Video: LoL Shield Audio Spectrum VU Meter: 4 Kauj Ruam (nrog Duab)
Video: Man Falls OVERBOARD and Boat Keeps Going! | Wavy Boats | Haulover Inlet 2024, Hlis ntuj nqeg
Anonim
LoL Shield Audio Spectrum VU Meter
LoL Shield Audio Spectrum VU Meter

Nov yog lub tshuab ntsuas suab VU ntsuas siv LoL Shield rau Arduino. LoL Shield yog 14 x 9 LED matrix uas haum rau Arduino ua daim ntaub thaiv thiab raug tswj los ntawm txoj hauv kev zoo uas hu ua Charlieplexing. Nws tau tsim los ntawm Jimmie P. Rodgers. Txoj haujlwm no siv Fast Fourier Transform lub tsev qiv ntawv rau Arduino los tshuaj xyuas lub teeb liab, ua kom nws tawg mus rau hauv cov zaus, thiab tso tawm cov ntaub ntawv ntawd ntawm LoL Shield. Arduino microcontroller tau nrawm txaus los laij Fourier kev hloov pauv sai. Nws nyob ntawm nws lub npe thiab yog qhov xav tsis thoob sai thiab raug. Txij li txhua txoj haujlwm tau ua tiav los ntawm lub microcontroller, txoj haujlwm no tuaj yeem nqa tau yog tias koj siv roj teeb. Lub vev xaib rau qhov haujlwm no nyob ntawm https://andydoro.com/vulol/ & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; lt; br /& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; kev; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; gt; Qhov yuav tsum tau:

  • LoL ntaub thaiv npog
  • Arduino (Diavolino pom zoo)
  • audio jack (Kuv siv tus txiv neej mono 1/8 "xov tooj ntsaws)
  • Arduino chaws
  • fais fab mov (DC fais fab mov, USB cable, roj teeb 9V, thiab lwm yam)

Kauj Ruam 1: Sib dhos LoL Shield

Sib dhos LoL Shield
Sib dhos LoL Shield

Ua raws cov lus qhia kom sib sau LoL Shield ntawm no. Saib, qhov ntawd tsis siv sijhawm ntev kiag li!

Kauj Ruam 2: Cov Hluav Taws Xob Hluav Taws Xob rau Lub Suab Jack

Solder Wires rau Audio Jack
Solder Wires rau Audio Jack

Kuv tab tom siv tus txiv neej mono 1/8 lub xov tooj ntsaws, raws li nws tau hu ntawm Radioshack, tab sis koj tuaj yeem siv lub xov tooj kab ntawv twg yog qhov tsim nyog rau koj teeb tsa lub suab. Koj tuaj yeem siv lub microphone yog tias koj xav tau. Rau hom ntsaws no, Kuv tau siv ob lub xov hlau. Kuv siv liab thiab dub. LoL Shield tawm cov pins analog 4 thiab 5 dawb rau cov tswv yim. Kuv tus lej siv tus pin 5. Koj tuaj yeem txuas cov xaim liab rau analog pin 5 ntawm LoL Shield thiab xaim dub rau GND Koj tsis tas yuav muab nws tso rau hauv, Kuv tsuas yog muab cov hlau hla thiab khoov nws.

Kauj ruam 3: Program Arduino

Qhov program Arduino
Qhov program Arduino

Tam sim no peb xav tau program Arduino los tswj LoL Shield.

Nws raug nquahu kom siv Diavolino los tswj LoL Shield txhawm rau tiv thaiv "dab" cuam tshuam rau ntawm LEDs vim ntsuab ntsuab nto LED txuas nrog tus pin 13 ntawm tus qauv Arduino, tab sis tus qauv Arduino yuav ua haujlwm zoo.

Qhov no xav tau ob lub tsev qiv ntawv Arduino: - FFT lub tsev qiv ntawv pom ntawm Arduino lub rooj sab laj - Charlieplexing lub tsev qiv ntawv rau LoL Shield

Txhim kho cov tsev qiv ntawv rau Arduino tuaj yeem ua rau txaus siab me ntsis yog tias koj tsis tau ua nws ua ntej, tab sis koj yuav ua tau zoo!

Ua raws cov lus qhia ntawm kev txhim kho Arduino cov tsev qiv ntawv ntawm no:

www.arduino.cc/en/guide/libraries

Lub tsev qiv ntawv FFT tsoo lub suab lub suab hauv 64 zaus. LoL Shield yog 14 x 9 LEDs. Peb nruab nrab ntawm 64 zaus sib koom ua ke rau hauv 14 zaus. Peb tab tom pov tseg qee cov ntaub ntawv vim tias 14 tsis faib ua 64 tus lej, tab sis dab tsi. Tus nqi ntawm txhua qhov ntau zaus tau rov qab los ntawm 0 txog 9.

Koj tuaj yeem luam cov lej Arduino hauv qab no, tau txais cov cai los ntawm GitHub (pom zoo), lossis rub tawm. ZIP cov ntaub ntawv, uas suav nrog cov tsev qiv ntawv thiab Arduino code.

Nov yog GitHub txuas:

github.com/andydoro/LoLShield-FFT

Hauv qab no yog Arduino code:

/* FFT rau LoL Shield v0.9 los ntawm Andy Doro https://andydoro.com/based ntawm FFT lub tsev qiv ntawv thiab cov cai los ntawm Arduino cov rooj sib tham thiab Charlieplexing tsev qiv ntawv rau LoL Shield. */

#suav nrog "Charliplexing.h"

#suav nrog "fix_fft.h"

#define AUDIOPIN 5 char im [128], cov ntaub ntawv [128]; char data_avgs [14];

int kuv = 0, val;

void teeb () {LedSign:: Init (); // Pib LoL Shield}

void voj () {

rau (i = 0; i <128; i ++) {val = analogRead (AUDIOPIN); data [kuv] = val; im [kuv] = 0; };

fix_fft (cov ntaub ntawv, im, 7, 0);

rau (i = 0; i <64; i ++) {data = sqrt (data * data +im * im ); // qhov no tau txais cov txiaj ntsig zoo ntawm cov txiaj ntsig hauv kab ntawv, yog li peb tsuas yog cuam tshuam nrog cov lej zoo};

// nruab nrab tuav ua ke rau (i = 0; i <14; i ++) {data_avgs = data [i*4] + data [i*4 + 1] + data [i*4 + 2] + data [kuv*4 + 3]; // nruab nrab ua ke data_avgs = daim ntawv qhia (data_avgs , 0, 30, 0, 9); // remap qhov tseem ceeb rau LoL}

// teeb tsa LoLShield

rau (int x = 0; x <14; x ++) {rau (int y = 0; y <9; y ++) {yog (y <data_avgs [13-x]) {// 13-x thim rov qab cov kab qis heev mus rau qhov ntau zaus tau sawv cev ntawm sab laug mus rau sab xis. LedSign:: Teeb (x, y, 1); // teeb lub LED rau} lwm {LedSign:: Teeb (x, y, 0); // teeb lub LED tawm}}}

}

Kauj ruam 4: Txaus siab rau

Txaus siab rau !!
Txaus siab rau !!

& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; lt; br & amp; amp; amp; tswb amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; gt; Txuas lub suab tso rau koj lub tso suab, iPod, khoos phis tawj, thiab lwm yam. Ua kom lub zog Arduino nrog DC lub zog xa khoom, USB los ntawm koj lub khoos phis tawj lossis roj teeb- qhov no yog qhov ua tiav. Koj tuaj yeem muab nws tso rau hauv lub kaus mom lossis txoj siv sia. Cov LEDs dawb yog qhov ci heev nws nyuaj rau ntes hauv video. Nws zoo li muaj nplaim paj liab tawm ntawm lawv! Zaum rov qab thiab txaus siab!

Kev sib tw Microcontroller
Kev sib tw Microcontroller
Kev sib tw Microcontroller
Kev sib tw Microcontroller

Finalist in the Microcontroller Contest

Pom zoo: