Cov txheej txheem:

Suab paj nruag Digital Interface: 6 Kauj Ruam (nrog Duab)
Suab paj nruag Digital Interface: 6 Kauj Ruam (nrog Duab)

Video: Suab paj nruag Digital Interface: 6 Kauj Ruam (nrog Duab)

Video: Suab paj nruag Digital Interface: 6 Kauj Ruam (nrog Duab)
Video: Aib xyooj los qhia ntaus nkauj haum xov tooj ORG2022 2024, Hlis ntuj nqeg
Anonim
Suab paj nruag Digital Interface
Suab paj nruag Digital Interface

Zoo siab txais tos txhua tus, Kuv xav qhia koj kuv tus kheej Lub Suab Nkauj Digital Interface. Kuv tau ua nws thaum kuv qib kev paub suab, qhov no yog kuv cov ntawv tshawb fawb. Yuav pib, Kuv nug kuv li cas kuv tuaj yeem sau nkauj tsis muaj DAW, nrog cov khoom siv rov ua dua tshiab thiab muaj peev xwm ua si ib leeg.

Hauv cov lus qhia no, kuv yuav qhia koj siv kev sib txuas lus txuas mus rau xa/tau txais cov ntaub ntawv ntsuas (analog & digital) cov ntaub ntawv los ntawm Arduino rau Raspberry pi ntawm software puredata rau ua rau muaj suab nrov.

Cov ntaub ntawv xav tau yog:

x1 Raspberry PI3

x1 Boîter de tiv thaiv PI3

x1 Micro SD (32G)

x1 Arduino UNO

x1 Sensor IR Ntse GP2Y0E02B

x1 Pub

x1 Phaj ntsuas ntsuas (0.2)

x28 Kuj 10MΩ

x2 Kuj 1.8kΩ

x1 Kuj 10 kΩ

x20 Terminal lugs Txiv neej/Poj niam

x1 Cov neeg nqa khoom

x1 coil ntawm tin (1 meter)

x1 Cov hlau nplaum

x25 Flexibles Straps Txiv neej/Txiv neej

Kauj ruam 1: Sensors

Sensors
Sensors
Sensors
Sensors
Sensors
Sensors

Kuv siv 4 piezoelectric los ntawm "Guitar Hero" Harmonix XBOX 360 chaw taws teeb. Kuv siv lub pob rau/tawm vim hais tias reed hloov sib nqus ntawm jam ko taw pedal guitar hero remote tau tawm.

Kuv siv IR sensor Ntsej Muag GP2Y0E02B. Rau txhua qhov ntawm cov ntsuas no, Kuv tau rub tawm los ua ke kom ua haujlwm tau zoo …

Yog li ntawd qhov tseeb kuv pom qhov tsis kam ua rau lub khawm sensor thiab IR sensor. Txawm li cas los xij kuv sim piezoelectric txhawm rau paub tag nrho qhov ntsuas ntawm qhov no, thiab kho qhov tsis kam tus nqi xav tau thiab thov rau 4 analog sensors.

Kauj ruam 2: Rub tawm Montage

Rub tawm Montage
Rub tawm Montage
Rub-up Montage
Rub-up Montage
Rub-up Montage
Rub-up Montage
Rub-up Montage
Rub-up Montage

Tom qab kuaj piezoelectric nrog lub tshuab hluav taws xob, kuv kho qhov tsis kam tus nqi ntawm 7MΩ.

Lub khawm tsis kam sib dhos rub tawm yog 10 kΩ.

Rau IR sensor, Kuv siv ob 1, 8kΩ tsis kam nruab nrab ntawm cov khoom siv hluav taws xob thiab SDA (cov ntaub ntawv) thiab SCL (moos).

Ceev faj vim tias cov kev tawm tsam tus nqi yog rau RTX Arduino UNO; qee yam kom paub txog Arduino impedance input: 10MΩ.

Koj tuaj yeem pom qhov rub tawm ntawm cov duab kawg ntawm cov kauj ruam no; Kuv kho cov hlua piezoelectric hauv 0 1 2 3 pins ntawm UNO, khawm pluaj hauv 2 tus lej digital tab sis sib txuas lus tus nqi ntawm 6 tus pin ntawm UNO thiab IR sensor pluaj hauv 4 5 pins ntawm UNO, txhua qhov kev sib piv ntawm Arduino Uno.

Kauj ruam 3: Code Arduino

Txhawm rau kom ntseeg tau tias kev ua haujlwm tau zoo, Kuv sim xa/tau txais cov ntaub ntawv ntawm cov sensors mus rau Arduino.

Kuv muab cov ntaub ntawv piav qhia tab sis koj tuaj yeem pom lawv hauv piv txwv ntu ntawm Arduino Genuino programmation, tshwj tsis yog IR sensor vim nws tsis ua tiav, Kuv tau hloov pauv ob peb cov ntaub ntawv hauv ntu "txhais" zoo li "ua haujlwm" thiab kuv hloov kev ntsuas ntsuas kom tsis tu ncua nyob ntawm qhov kev hloov pauv nyob deb. Tej zaum koj tau pom "Hlau" hauv IR sensor code. Tseeb kuv siv I2C raws tu qauv los sib txuas lus. Kuv caw koj kom pom I2C raws tu qauv, txaus nyiam heev, koj tuaj yeem siv qhov no los xa tawm ntawm lub sijhawm tiag tiag txhua qhov digitometer uas koj xav tau.

Kauj Ruam 4: Ob qho Arduino Raspberry Serial Communication

Ob qho Arduino Raspberry Serial Communication
Ob qho Arduino Raspberry Serial Communication
Ob qho Arduino Raspberry Serial Communication
Ob qho Arduino Raspberry Serial Communication

Yog: D

Raws li koj tuaj yeem pom hauv thawj daim duab, txuas Arduino-Raspberry yog USB ntsaws.

Kuv pom txoj hauv kev kom tau txais cov ntaub ntawv cov ntaub ntawv ncaj qha los ntawm PureData Extented uas tau teeb tsa hauv Raspberry PI. Vim li cas PureData Txuas Ntxiv? Vim tias Vanilla version tsis siv tib lub tsev qiv ntawv ntau dua li daim ntawv thov hauv Raspbian ib puag ncig.

Yog li tso StandardFirmata hauv Arduino Genuino txhawm rau txhim kho I/O thiab tus nqi hloov pauv txoj kev yog!

Kom tau txais rov qab tus nqi cov ntaub ntawv qhia hauv Raspberry PI, muaj 2 txoj cai muaj: Firmata thiab Msg.

Kuv xaiv Firmata rau ib qho laj thawj, nws yooj yim dua kom tau txais cov ntaub ntawv hauv PureData ntawm thaj Pduino, ib puag ncig.

Kuv caw koj mus tshawb nrhiav Msg yog tias koj siv OSC raws tu qauv.

Kauj Ruam 5: Patch PureData Tau Txais

PureData Patch Tau Txais
PureData Patch Tau Txais

Tseeb, tom qab lub lis piam coding ntawm Genuino, kuv ua tiav tau txais tag nrho kuv cov sensor cov ntaub ntawv hauv ib nplooj ntawv, qhov no tau tso cai pom kev hloov pauv ntawm lub sijhawm tiag tiag ua tsaug rau Pduino, thaj hauv Puredata, ntu qiv qiv ntxiv.

Los ntawm cov kauj ruam no, peb tsis kov ntxiv lawm ntawm Arduino code. Tus nqi cov ntaub ntawv tuaj yeem nyeem tau.

Raws li kuv pom hauv qib 3, Kuv tau txais cov ntaub ntawv los ntawm cov khawm digital hauv 6 tus pin analog, nws yooj yim pom kev ua haujlwm tau zoo ntawm kev sib txuas lus. Tag nrho hauv ib kab.

Kauj Ruam 6: Kev Txhim Kho PureData

Kev Txhim Kho PureData
Kev Txhim Kho PureData
Kev Txhim Kho PureData
Kev Txhim Kho PureData
Kev Txhim Kho PureData
Kev Txhim Kho PureData
Kev Txhim Kho PureData
Kev Txhim Kho PureData

PureData yog hom lus tshwj xeeb thiab koj yuav tsum siv koj lub sijhawm dawb kom ua tiav kev ua haujlwm zoo.

Qee qhov PureData thaj yuav muaj nyob hauv GitHub.

Kuv vam tias qhov kuv tau sau ntawm no tau pab koj pib koj li haujlwm ze rau kuv.

Pom zoo: