Cov txheej txheem:

Kev Paub Hais Lus: 12 Kauj Ruam
Kev Paub Hais Lus: 12 Kauj Ruam

Video: Kev Paub Hais Lus: 12 Kauj Ruam

Video: Kev Paub Hais Lus: 12 Kauj Ruam
Video: qhia txog kev hai lus ua plaub luag saib tsis yus tus neeg ruam 7/12/22 2024, Hlis ntuj nqeg
Anonim
Hais Lus Paub
Hais Lus Paub

Nyob zoo txhua tus ………

Nov yog kuv qhov lus qhia thib ob uas kuv tshaj tawm

Yog li txais tos txhua tus …

Hauv Cov Lus Qhia no Kuv yuav qhia koj txog yuav ua li cas txhim tsa lub suab lees paub siv lub rooj sib tham arduino.

Yog li kuv xav tias koj tau muaj kev paub dhau los nrog cov laug cam ua ntej. Yog tsis yog, nws tsis yog txhua qhov teeb meem loj loj ntawm no. Tab sis kuv qhia koj kom siv nws vim nws yog qhov nthuav heev los ua si nrog nws thiab tsim qee qhov haujlwm txias. tawm ntawm nws raws li koj lub tswv yim thiab kev paub ntawm nws.

Yog li rau cov neeg uas tsis muaj kev paub dhau los siv arduino:

Arduino yog lub khoos phis tawj qhib khoos phis tawj uas tsim los ntawm lub tuam txhab uas muaj zej zog loj ntawm cov tsim qauv thiab cov tsim khoom

Arduino tau teeb tsa hauv ib puag ncig tsim los ntawm lawv tus kheej uas tuaj yeem rub tawm tau yooj yim los ntawm lawv lub vev xaib

Kauj Ruam 1: Yuav Teeb Li Cas Ib puag ncig?

Yuav Teeb Li Cas Ib puag ncig?
Yuav Teeb Li Cas Ib puag ncig?
Yuav Teeb Li Cas Ib puag ncig?
Yuav Teeb Li Cas Ib puag ncig?
Yuav Teeb Li Cas Ib puag ncig?
Yuav Teeb Li Cas Ib puag ncig?
Yuav Teeb Li Cas Ib puag ncig?
Yuav Teeb Li Cas Ib puag ncig?

Tsuas yog tshawb hauv google "download arduino"

Nyem rau ntawm "Arduino - Software"

Koj yuav tuaj yeem pom "Rub tawm Arduino IDE"

Xaiv nyob ntawm koj lub operating system

Rub tawm thiab nruab nws

Yog li koj tau ua tiav teeb tsa lub software thiab koj tuaj yeem sau koj cov cai rau arduino thiab nrog kev pab ntawm kab hluav taws xob koj tuaj yeem txuas lub rooj tsav xwm arduino rau lub khoos phis tawj thiab tuaj yeem ntxig tus lej.

Kauj Ruam 2: Vim Li Cas Qhov Xav Tau rau Arduino Raising?

Tsis kim

Cov laug cam Arduino tsis kim rau kev sib piv nrog lwm lub micro-controller platforms. Nws yuav raug nqi ib ncig $ 50.

Hla-platform

Software rau Arduino ua haujlwm ntawm Windows, Macintosh OS, thiab Linux operating systems. Yog tias peb xav txog lwm lub tshuab tswj hwm nws nws yuav ua haujlwm nkaus xwb hauv Windows lossis hauv lwm lo lus txwv tsuas yog rau windows.

Qhib qhov chaw thiab txuas ntxiv software

Lub software tau qhib qhov chaw, yog li cov tib neeg pib kawm txog nws tob thiab suav nrog cov tsev qiv ntawv (uas suav nrog cov txheej txheem rau nws ua haujlwm) ntawm lwm cov lus programming.

Ib puag ncig yooj yim thiab yooj yim programming

Nws yog qhov yooj yim siv Arduino IDE (software uas peb tau tham txog ….) txog nws.

Qhib qhov chaw thiab kho vajtse txuas ntxiv tau

Cov phiaj xwm ntawm Arduino cov laug cam tau tshaj tawm nyob rau hauv Creative Commons daim ntawv tso cai, yog li cov neeg uas muaj kev paub dhau los hauv kev tsim hluav taws xob tuaj yeem tsim lawv tus kheej cov qauv, lawv kuj muaj txoj cai txuas ntxiv thev naus laus zis thiab tuaj yeem txhim kho los ntawm kev ntxiv cov yam ntxwv rau nws.

Kauj Ruam 3: Cia Peb Pib !!!!

Yog li kuv twb tau hais tias txoj haujlwm no feem ntau yog tsom rau kev paub lub suab siv Arduino thiab tso cai rau nws ua qee yam haujlwm.

Sib tham kom meej dua ……

Nws tuaj tos lub suab qhia los ntawm tus neeg siv, uas tuaj yeem kuaj pom los ntawm kev ntsais ntawm LED tom qab uas tau hloov pauv mus rau kev sib txuas lus.

Kauj Ruam 4: Cov Cheeb Tsam Yuav Tsum Tau

Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau
Cov Cheeb Tsam Yuav Tsum Tau

Lub hauv paus tseem ceeb xav tau rau txoj haujlwm no yog:

Arduino Dua x1

Txim lom zem Electret Microphone Breakout x 1

Spark Fun Mono Audio Amp Breakout x 1

Hais lus: 0.25W, 8 ohms x 1

Breadboard x 1

5 hli LED: Liab x 3

Resistor 330 ohm x 3

Jumper xov x 1

Soldering Hlau x 1

BitVoicer neeg rau zaub mov

Nws yog kev lees paub hais lus thiab sib txuas ua haujlwm rau kev hais lus siv tshuab.

Kauj Ruam 5: Nws Ua Haujlwm Li Cas?

1. Lub suab tsis tau pom tawm tom qab ntawd nws ntes cov nthwv dej no thiab tau nthuav dav los ntawm Sparkfun Electret Breakout board.

2. Lub teeb liab tau txais los ntawm cov txheej txheem saum toj no yuav yog digitalized thiab tsis ua/khaws cia hauv Arduino pawg thawj coj siv nws cov analog-rau-digital converter (ADC) tam sim no hauv nws.

3. Lub suab ntsuas yuav muab rau BitVoicer Server siv Arduino qhov chaw nres nkoj txuas tam sim no.

4. BitVoicer Server yuav ua cov suab ntws thiab tom qab ntawd nws lees paub cov lus nws muaj.

5. Kev lees paub hais lus yuav raug teeb tsa rau cov lus txib uas twb tau txhais los ntawm nws tus kheej ua ntej, tom qab ntawd nws yuav raug xa rov qab mus rau Arduino. Yog tias ib qho ntawm cov lus txib suav nrog kev sib tham hais lus, BitVoicer Server yuav npaj lub suab tso tawm thiab xa mus rau Arduino.

6. Arduino yuav txheeb xyuas cov lus txib uas tau muab thiab ua qee qhov kev nqis tes ua uas tsim nyog. Yog tias tau txais lub suab tso tawm, nws yuav raug ntaus rau hauv chav BVS Tus Hais Lus thiab ua si siv DUE DAC thiab DMA.

7. Lub SparkFun Mono Audio Amplifier yuav ua kom nrov DAC teeb liab kom nws tuaj yeem tsav tus neeg hais lus 8 Ohm thiab tuaj yeem hnov los ntawm nws.

Kauj Ruam 6: Txuas Cov Khoom Siv

Txuas Cov Txheej Txheem
Txuas Cov Txheej Txheem
Txuas Cov Txheej Txheem
Txuas Cov Txheej Txheem

Thawj kauj ruam tseem ceeb yog xaim cov khoom sib txawv hauv lub khob cij thiab tseem nrog lub rooj sib tham arduino raws li qhia hauv daim duab

Nco ntsoov lub rooj tsav xwm arduino siv ntawm no yog DUE, muaj lwm qhov qauv sib txawv uas tau tsim los ntawm Arduino txhua qhov ua haujlwm ntawm qib sib txawv

Feem ntau ntawm Arduino cov laug cam ua haujlwm ntawm 5 V, tab sis DUE khiav ntawm 3.3 V

DUE twb tau siv 3.3 V analog siv yog li koj tsis xav tau jumper mus rau AREF tus pin

Huag thov txim, kuv tsis nco qab hais tus pin AREF yog "ANALOG REFERENCE PIN" uas muaj nyob hauv pawg thawj coj saib Arduino raws li qhia hauv daim duab tom ntej (Nws yog arduino UNO tab sis nws zoo sib xws hauv qhov chaw zoo li DUE)

AREF tus pin ntawm DUE txuas nrog lub micro-controller los ntawm tus choj resistor

Txhawm rau siv tus pin AREF, tus tiv thaiv R1 yuav tsum tau muab pov tseg los ntawm PCB [Luam Ntawv Circuit Board]

Kauj Ruam 7: Muab Txoj Cai rau Arduino Board

Muab Txoj Cai rau Arduino Board
Muab Txoj Cai rau Arduino Board

Yog li peb yuav tsum xa cov cai mus rau Arduino Board, yog li nws tuaj yeem ua haujlwm tau raws li cov lus qhia hauv kab lus.

Nws yog qhov yooj yim heev los ua qhov no. Kuv yuav piav qhia txhua tus ntawm lawv kom ntxaws, txog qhov lawv ua thiab lawv ua haujlwm li cas.

Yuav Ua Li Cas Nruab Lub Tsev Qiv Ntawv?

Yog li ua ntej ntawd peb yuav tsum paub yuav nruab BitVoicer Server libraries rau hauv Arduino IDE,.that mus rau software arduino.

Yog li rau qhov qhib Arduino IDE

Nyob rau sab saum toj vaj huam sib luag nyem rau ntawm "Sketch"

Tom qab ntawd nyem rau "suav nrog Lub Tsev Qiv Ntawv"

Hauv qhov ntawd nyem rau ntawm "Manage Library"

Tom qab ntawd tus saib xyuas lub tsev qiv ntawv yuav qhib thiab peb tuaj yeem pom cov npe ntawm cov tsev qiv ntawv uas tau npaj rau kev teeb tsa lossis cov uas twb tau teeb tsa lawm

Tshawb nrhiav lub tsev qiv ntawv los nruab thiab tom qab ntawd xaiv tus lej version

Ntawm no peb tab tom txhim kho BitVoicer Server cov tsev qiv ntawv, uas yog qhov tsim nyog rau txoj haujlwm no

Yuav ua li cas ntshuam lub tsev qiv ntawv.zip?

Cov tsev qiv ntawv tseem tuaj yeem faib ua ZIP cov ntaub ntawv lossis ntawv tais ceev tseg

Lub npe ntawm daim nplaub tshev yog lub npe ntawm lub tsev qiv ntawv

Sab hauv daim nplaub tshev yuav yog.cpp cov ntaub ntawv, a.h cov ntaub ntawv thiab feem ntau yog lo lus tseem ceeb.txt, piv txwv cov nplaub tshev, thiab lwm cov ntaub ntawv xav tau los ntawm lub tsev qiv ntawv

Los ntawm version 1.0.5 ntawm Arduino IDE, koj tuaj yeem teeb tsa thib peb lub tsev qiv ntawv hauv nws

Tsis txhob unzip lub tsev qiv ntawv rub tawm, tso nws zoo li

Txog qhov ntawd mus rau kos duab> suav nrog Tsev qiv ntawv> Ntxiv.zip Lub Tsev Qiv Ntawv

Xaiv qhov chaw ntawm cov ntaub ntawv.zip thiab qhib nws.

Rov qab mus rau Sketch> Ntshuam Tsev qiv ntawv ntawv.

Yog tias nws raug xa tawm kom raug ces lub tsev qiv ntawv yuav tsum pom nyob hauv qab ntawm cov ntawv qhia zaub mov nco-down thaum koj mus.

Kauj Ruam 8: Program/Sketch

Nov yog qhov haujlwm uas yuav tsum tau muab tso rau hauv Arduino.

Nws tuaj yeem ua tiav yooj yim los ntawm kev txuas Arduino Board rau lub khoos phis tawj thiab xa nws mus rau lub rooj tsavxwm.

Kauj Ruam 9: Ua Li Cas Txog Cov Cai Sau?

Tam sim no cia peb saib dab tsi ntawm txhua txoj haujlwm tau sau hauv cov cai tau ua ………….

Cov tsev qiv ntawv cov neeg ua tim khawv thiab cov ntawv tshaj tawm sib txawv

Ua ntej tham txog qhov no peb yuav tsum paub thiab nkag siab qee cov ntsiab lus yooj yim. Qhov no suav nrog:

  • BVSP

    Nws yog lub tsev qiv ntawv uas muab rau peb yuav luag txhua cov peev txheej uas xav tau los sib pauv cov ntaub ntawv nrog BitVoicer Server

    Muaj cov txheej txheem tam sim no paub tias yog BitVoicer Server Protocol uas tau ua tiav los ntawm chav kawm ntawm BVSP. Qhov no yuav tsum tau txhawm rau cuam tshuam nrog tus neeg rau zaub mov

  • BVSMic

    Nws yog lub tsev qiv ntawv uas ua tiav txhua yam uas yuav tsum tau kaw lub suab siv Analog-to-Digital Converter (ADC) ntawm Arduino

    Lub suab no tau khaws cia hauv chav kawm tsis nyob hauv thiab lawv tuaj yeem khaws rov qab thiab tom qab ntawd nws tuaj yeem xa mus rau lub tshuab hais lus paub uas muaj nyob ntawm BitVoicer Server

  • BVSSpeaker

    Nws yog lub tsev qiv ntawv uas muaj tag nrho cov peev txheej tseem ceeb uas yuav tsum tau tsim dua cov suab xa tawm los ntawm BitVoicer Server

    Txog qhov ntawd Arduino pawg thawj coj yuav tsum muaj tus tsim ua Digital-to-Analog Converter (DAC)

    Arduino DUE tsuas yog Arduino pawg thawj coj uas muaj DAC ua ke

BVSP, BVSMic, BVSSpeaker thiab DAC cov tsev qiv ntawv, qhov siv rau cov no tau sau rau ntawm thawj plaub kab uas ua rau pom qhov kev zov me nyuam

Thaum koj nruab BitVoicer Server koj tuaj yeem pom BitSophia uas muab tag nrho plaub lub tsev qiv ntawv no

Thaum tus neeg siv ntxiv cov ntaub ntawv xa mus rau BVSSpeaker lub tsev qiv ntawv DAC lub tsev qiv ntawv uas tau hais ua ntej yuav raug txiav tawm

BVSP chav kawm yog siv los sib tham nrog BitVoicer Server

BVSMic chav kawm yog siv los ntes thiab khaws cov suab

BVSSpeaker chav kawm yog siv los tsim cov suab siv Arduino DUE DAC

2. teeb muaj nuj nqi

Lub teeb ua haujlwm tau siv los ua qee yam kev ua xws li:

Txhawm rau teeb tus qauv pin thiab lawv lub xeev pib

Txhawm rau pib ua kev sib txuas lus

Txhawm rau pib qib BVSP

Txhawm rau pib ua BVSMic chav kawm

Txhawm rau pib ua BVSSpeaker chav kawm

Nws kuj tseem teeb tsa "tus tuav cov xwm txheej" (tus taw qhia ua haujlwm) rau tus ncejReceived, modeChanged thiab streamReceived events of the BVSP class

Kauj Ruam 10: Loop Function

Nws ua tsib txoj haujlwm tseem ceeb:

1. keepAlive () muaj nuj nqi

Txoj haujlwm no yog thov tus neeg rau zaub mov txog cov ntaub ntawv xwm txheej.

2. tau txais () muaj nuj nqi

Txoj haujlwm no yog txhawm rau txheeb xyuas seb tus neeg rau zaub mov tau xa tawm cov ntaub ntawv lossis tsis yog. Yog Server xa cov ntaub ntawv nws yuav ua nws.

3. isSREAvailable (), startRecording (), stopRecording () thiab sendStream () functions

Cov haujlwm no tau siv los tswj hwm ntau qhov chaw ntawm kaw suab thiab tom qab thaum nws ua tiav lub suab nws yuav xa lub suab no mus rau BitVoicer Server.

4. ua si () muaj nuj nqi

Lub luag haujlwm no yog siv los ua lub suab uas tau nyob ua ke ntawm BVSSpeaker chav kawm.

5. ua siNextLEDNote ()

Lub luag haujlwm no yog siv los tswj seb Led yuav tsum ntsais li cas.

6. BVSP_frameReceived muaj nuj nqi

Txoj haujlwm no hu ua txhua lub sijhawm thaum tau txais () muaj nuj nqi pib txheeb xyuas tias tau txais ib kab lus tiav. Cov lus txib uas tswj hwm kev ntsais ntawm LEDs yog ntawm 2 Bytes. Hauv thawj lo lus qhia tus lej thiab thib ob byte qhia tus lej tus lej. Ntawm no peb siv analogWrite () ua haujlwm los teeb tus nqi tsim nyog rau tus pin. Lub sijhawm ntawd peb tseem yuav tsum tshuaj xyuas seb puas tau ua si LEDNotes hais kom ua, uas yog hom Byte, tau txais. Yog tias nws tau txais, Kuv teeb playLEDNotes rau qhov tseeb thiab nws yuav saib xyuas thiab cim lub sijhawm tam sim no. Lub sijhawm no yuav siv los ntawm playNextLEDNote muaj nuj nqi los ua ke cov LEDs nrog zaj nkauj.

7. BVSP_modeChanged muaj nuj nqi

Lub luag haujlwm no yog hu ua txhua lub sijhawm thaum tau txais () muaj nuj nqi qhia txog kev hloov pauv hauv hom kev tawm mus (Server Arduino). BitVoicer Server tuaj yeem xa cov ntaub ntawv lossis suab mus rau Arduino. Ua ntej kev sib txuas lus mus los ntawm ib hom mus rau lwm qhov, BitVoicer Server xa lub teeb liab. Hoob BVSP txheeb xyuas lub teeb liab no thiab tsa lossis chij qhov kev hloov pauv tshwm sim. Hauv BVSP_modeChanged muaj nuj nqi, yog tias tus neeg siv pom tias kev sib txuas lus tau dhau los ntawm hom kwj mus rau hom kab, nws/nws yuav paub lub suab tau xaus lawm yog li tus neeg siv tuaj yeem qhia rau BVSSpeaker chav kawm kom tsis txhob ua suab.

8. BVSP_streamReceived muaj nuj nqi

Txoj haujlwm no hu ua txhua lub sijhawm thaum tau txais () muaj nuj nqi txheeb xyuas tias tau txais cov qauv suab. Nws tsuas yog khaws lub suab thiab ua kab lawv rau hauv BVSSpeaker chav kawm yog li kev ua si () ua haujlwm tuaj yeem rov tsim dua lawv.

9. playNextLEDNote muaj nuj nqi

Txoj haujlwm no tsuas yog ua haujlwm yog tias BVSP_frameReceived muaj nuj nqi qhia txog kev ua si LEDNotes hais kom ua. Nws tswj hwm thiab ua ke cov LEDs nrog lub suab xa los ntawm BitVoicer Server. Txhawm rau synchronize cov LED nrog lub suab thiab paub lub sijhawm raug, siv software dawb Sonic Visualizer tuaj yeem siv. Nws tso cai rau peb saib lub suab nthwv dej kom tus neeg tuaj yeem tuaj yeem qhia thaum twg tus lej piano tau raug nias.

Kauj Ruam 11: Yuav Ua Li Cas Ntshuam BitVoicer Server Cov Hom Phiaj?

Tam sim no peb tau teeb tsa BitVoicer Server ua haujlwm nrog Arduino.

Muaj plaub lub ntsiab lus daws teeb meem rau BitVoicer Server: Cov chaw, Cov cuab yeej, BinaryData thiab Lub Suab Schemas.

Cia peb saib cov no kom ntxaws:

Qhov chaw

Nws sawv cev rau lub cev qhov chaw uas lub cuab yeej raug teeb tsa.

Peb tuaj yeem tsim qhov chaw hu ua Tsev.

Devices

Lawv raug suav tias yog raws li cov neeg siv khoom ntawm BitVoicer Server.

Zoo li tsim qhov chaw peb tuaj yeem tsim cov khoom sib xyaw, kom yooj yim cia peb sau nws ua ArduinoDUE.

Qee zaum qee qhov tsis tuaj yeem tuaj yeem tshwm sim yog li tshem nws Kuv yuav tsum txwv Tus Nqi Tus Nqi hauv kev sib txuas lus teeb tsa mus rau 8000 tus qauv ib pliag.

BinaryData yog hom lus txib BitVoicer Server tuaj yeem xa mus rau cov neeg siv khoom. Lawv yog qhov tseeb byte arrays koj tuaj yeem txuas rau cov lus txib.

Thaum BitVoicer Server lees paub hais lus hais txog qhov hais kom ua ntawd, nws xa cov byte array mus rau lub hom phiaj ntaus ntawv.

Yog li ntawd vim li cas kuv tau tsim ib qho khoom BinaryData rau txhua tus lej tus lej thiab npe lawv ArduinoDUEGreenLedOn, ArduinoDUEGreenLedOff thiab ntxiv rau.

Yog li kuv yuav tsum tsim 18 BinaryData khoom, yog li kuv qhia koj rub tawm thiab ntshuam cov khoom los ntawm VoiceSchema.sof cov ntaub ntawv uas tau muab hauv qab no.

Yog li dab tsi yog Voice Schema?

Suab Schemas yog qhov uas txhua yam los ua ke. lub luag haujlwm tseem ceeb ntawm lawv yog txhawm rau txheeb xyuas cov kab lus yuav tsum raug lees paub thiab txhua yam lus txib yuav tsum tau ua.

Rau txhua kab lus, koj tuaj yeem txhais ntau cov lus txib raws li koj xav tau thiab qhov kev txiav txim lawv yuav ua.

Koj tseem tuaj yeem txiav txim siab ncua ntawm txhua qhov lus txib tau muab.

BitVoicer Server txhawb nqa tsuas yog 8-ntsis mono PCM suab (8000 qhov piv txwv ib pliag) yog li yuav xav tau hloov cov ntaub ntawv audio rau hom ntawv no, muaj ntau qhov kev hloov pauv hauv online tam sim no hnub no thiab kuv pom zoo https://audio.online -convert.com/convert-to-wav.

Koj tuaj yeem ntshuam (Ntshuam Cov Hom Phiaj) txhua qhov kev daws teeb meem kuv siv hauv qhov haujlwm no los ntawm cov ntaub ntawv hauv qab no.

Ib ntawm lawv muaj DUE Device thiab lwm qhov muaj Lub Suab Schema thiab nws Cov Lus txib.

Kauj Ruam 12: Xaus

Koj mus !!!

Koj tau ua qhov haujlwm txaus thiab koj tuaj yeem tham nrog nws

Yog li pib tham ………………

Koj tuaj yeem ntsais lub LEDs thiab tib lub sijhawm koj tuaj yeem hais nws kom hu nkauj yog tias nws xav tau, nws cov cai twb tau muab lawm

Yog li kuv tau ua tiav Kuv Qhov Kev Qhia Thib Ob !!!!!!!!

Yog ……

Kuv xav tias txhua tus nkag siab nws …

Yog tias leej twg muaj lus nug thov koj xav nug kuv

Kuv yuav los nrog qhov qhia tau zoo yav tom ntej…

Nyob zoo …

Pom koj sai sai ……………

Pom zoo: