Cov txheej txheem:
- Kauj Ruam 1: Cov Khoom Xav Tau
- Kauj ruam 2: Cov Nyees khawm
- Kauj Ruam 3: Cov Khawm Khawm
- Kauj Ruam 4: Raspberry Pi
- Kauj ruam 5: Programming
- Kauj Ruam 6: Khiav Python Script ntawm Txhua Qhov Pib
- Kauj Ruam 7: Xaus Qhov Cim
Video: Playback Recorder Nrog Raspberry Pi: 7 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Nyob zoo sawv daws, Hauv cov lus qhia no kuv piav qhia yuav ua li cas kuv ua lub kaw suab playback siv Raspberry Pi. Cov cuab yeej yog Raspberry Pi tus qauv B+, nrog 7 lub khawm thawb rau saum, tus hais lus txuas nrog ib qho ntawm Pi tus usb chaw nres nkoj, thiab lub microphone txuas nrog rau lwm qhov chaw nres nkoj usb. Txhua lub pob tau cuam tshuam nrog lub suab, yog li nws tuaj yeem ua 7 suab sib txawv. Cov suab tau ua si tom qab nias lub pob me me. Txhawm rau sau lub suab tshiab, tsuas yog thawb lub pob rau ntau dua 1 vib nas this, kaw tom qab lub suab nrov, thiab tso lub pob tom kawg ntawm cov ntaub ntawv. Nws tsis tau txais ib qho yooj yim dua qhov ntawd!
Kauj Ruam 1: Cov Khoom Xav Tau
Rau qhov haujlwm no kuv xav tau:
- Raspberry Pi tus qauv B + thiab micro SD daim npav - 29.95 $ + 9.95 $
- Ib rooj plaub yas Raspberry Pi - 7.95 $
- USB hais lus - 12.50 $
- USB microphone - 5.95 $
- Ib nrab-qhov loj me perma-proto board-4.50 $
- 7 cov nyees khawm thawb - 2.50 $
Kuv kuj xav tau:
- Qee cov xaim hluav taws xob
- Txoj cai-kaum poj niam lub taub hau
- Qee cov ntoo, xim dub thiab kua nplaum rau lub khawm khawm
- Ib tug soldering hlau thiab solder
Kauj ruam 2: Cov Nyees khawm
Cov nyees khawm siv tau siab heev (6mm) kom lawv tuaj yeem hla cov ntaub ntawv tuab.
Kuv tso kuv 7 lub nyees khawm rau ntawm perma-proto board, uas yog zoo li lub khob cij, tshwj tsis yog cov khoom siv tau muab tso rau ntawm nws. Qhov no muaj zog dua li daim ntawv qhia zaub mov, thiab pheej yig dua li luam ntawv pcb. Txhua lub khawm txuas hauv av mus rau GPIO ntawm Raspberry Pi. Kuv tsis muaj tus tiv thaiv ntawm no txij li Pi twb muaj sab hauv rub tawm/nqis resistors uas yuav tau teeb tsa hauv qhov haujlwm. Hauv qhov no kuv tau teeb tsa lawv kom rub tawm (saib qhov program hauv qab no).
Cov nyees khawm tau muab tso rau txhua 4 kab, lossis txhua 0.4 hauv.
Kauj Ruam 3: Cov Khawm Khawm
Kuv tau ua cov ntaub ntawv yooj yim heev rau cov nyees khawm, nrog cov plywood los xij thiab cov ntoo txua ntoo. Qhov me me ntawm lub laub yuav tsum loj txaus kom muaj lub hauv paus khawm thiab lub rooj tsavxwm, tab sis me me txaus kom tso lub khawm sab saum toj ntawm rooj plaub. Kuv siv 1/4 nyob rau hauv x 1/4 hauv kab rov tav.
Tom qab ua kom ntseeg tau tias lub rooj tsavxwm haum rau hauv rooj plaub, cov dowels tau lo rau ntawm lub hauv paus ntawv. Cov qhov tom qab ntawd tau muab hlais rau ntawm daim ntawv saum toj kawg nkaus (lub rooj tsavxwm tuaj yeem siv los ua qhov cim txhua txhua 0.4 ntiv tes). Txhua qhov ntoo yog pleev xim rau, lub rooj tsavxwm muab tso rau hauv rooj plaub, thiab daim ntawv lo tau lo rau saum nws.
Kauj Ruam 4: Raspberry Pi
Kuv tsis xav muab cov xov hlau txuas ncaj qha rau Pi, yog tias kuv xav siv Pi rau lwm yam yav tom ntej. Yog li kuv tau muab cov xov hlau txuas rau sab xis-tus poj niam lub taub hau, thiab ntsaws lub taub hau ntawm Pi.
GPIOs siv yog 21, 26, 20, 19, 13, 6 thiab 5. Tus pin hauv av kuj tseem siv tau.
Lub microphone thiab tus hais lus tau yooj yim ntsaws rau hauv 2 ntawm 4 lub chaw nres nkoj usb.
Tus Pi tau siv los ntawm lub qhov hluav taws xob micro-usb
Kauj ruam 5: Programming
Txhawm rau program Pi, Kuv txuas nws rau internet siv tus ethernet cable, thiab tswj nws los ntawm lub khoos phis tawj deb siv VNC tus saib. Txawm li cas los xij, koj tsis tuaj yeem siv qhov teeb tsa no thawj zaug koj txuas rau Pi, vim tias OS tseem tsis tau teeb tsa thiab SSH tsis ua haujlwm. Yog li koj yuav tsum txuas lub vijtsam, keyboard thiab nas, tsawg kawg yog thawj zaug.
Nws yog qhov nyuaj heev los nrhiav cov lus txib kom kaw thiab ua suab nrov ntawm daim npav suab zoo. Nov yog cov lus txib uas ua haujlwm rau kuv:
-
aplay -D plughw: CARD = Device_1, DEV = 0 0.wav
Plays 0.wav
-
arecord 0.wav -D sysdefault: CARD = 1 -f cd -d 20
Cov ntaub ntawv rau siab tshaj 20 vib nas this hauv cov ntaub ntawv 0.wav, nrog cd zoo
Cov ntaub ntawv suab nyob hauv phau ntawv teev npe tsis raug (/home/pi). Cov ntaub ntawv suab rau lub beep kuj tseem tsim nyog, muab tso rau hauv phau ntawv teev npe tsis raug thiab hu ua beep.wav.
Python code nws tus kheej yog cov hauv qab no:
nab hab sej code rau Raspberry Pi playback recorder
ntshuam RPi. GPIO ua GPIO |
lub sij hawm ntshuam |
import os |
#variables: |
butPressed = [Tseeb, Tseeb, Tseeb, Tseeb, Tseeb, Tseeb, Tseeb]#yog khawm kuv raug nias, |
tus pin = [26, 19, 13, 6, 5, 21, 20] #GPIO pins ntawm txhua lub pob |
recordBool = Cuav#Muaj tseeb yog tias cov ntaub ntawv tseem tab tom ua |
GPIO.setmode (GPIO. BCM) |
rau kuv hauv ntau (0, 7): |
GPIO.setup (tus pin , GPIO. IN, pull_up_down = GPIO. PUD_UP) #sets Pi tus sab hauv resistors kom rub |
thaum Muaj Tseeb: |
rau kuv hauv ntau (0, 7): |
butPressed = GPIO.input (tus pin )#kuaj xyuas yog tias lub pob nyem |
yog tias tab sis Nyuaj == Tsis tseeb:#yog lub pob nyem |
timeTime = sij hawm.time () |
thaum tab sis Nias == Tsis raug thiab recordBool == Tsis tseeb: |
butPressed = GPIO.input (tus pin ) |
yog time.time () - yav dhau losTime> 1.0:#yog tias lub pob raug nias ntau dua li ib pliag, ces recordBool Yog Qhov Tseeb |
recordBool = Tseeb |
yog recordBool == Muaj tseeb: #if recordBool Yog Qhov Tseeb, nws ua suab nrov nrov thiab tom qab ntawd kaw |
os.system ("aplay -D plughw: CARD = Device_1, DEV = 0 beep.wav") |
os.system ("arecord %d.wav -D sysdefault: CARD = 1 -f cd -d 20 &" %i) #records rau siab tshaj 20 vib nas this hauv cov ntaub ntawv i.wav, nrog cd zoo |
thaum tab sis Nias == Cuav: |
butPressed = GPIO.input (tus pin ) |
os.system ("pkill -9 arecord")#cov ntaub ntawv raug tso tseg thaum lub pob raug tso tseg, lossis tom qab 20 vib nas this |
recordBool = tsis tseeb |
lwm tus: #if recordBool Tsis yog, nws ua suab i.wav |
os.system ("aplay -D plughw: CARD = Device_1, DEV = 0 %d.wav" %i) |
sijhawm.s pw (0.1) |
saib rawPlayback kaw kaw nrog ❤ los ntawm GitHub
Kauj Ruam 6: Khiav Python Script ntawm Txhua Qhov Pib
Txhawm rau khiav cov ntawv nab nab ntawm txhua Pi pib, cov kab hauv qab no tau muab tso rau hauv cov ntawv hu ua playback.desktop hauv nplaub tshev/home /pi /.config/autostart/
sau playback.py ntawm Raspberry Pi qhov pib
[Desktop nkag] |
Encoding = UTF-8 |
Hom = Daim Ntawv Thov |
Lub npe = Kev ua si |
Tawm tswv yim = Nov yog daim ntawv thov rov ua dua |
Exec = nab hab sej /home/pi/playback.py |
StartupNotify = cuav |
Terminal = muaj tseeb |
Thaum = tsis tseeb |
saib rawplayback.desktop tuav nrog ❤ los ntawm GitHub
Kauj Ruam 7: Xaus Qhov Cim
Thov qhia kuv tias koj xav li cas txog txoj haujlwm no hauv kab lus tawm tswv yim, qhia rau kuv paub txog koj cov lus pom zoo, thiab pov npav rau kuv hauv kev sib tw Raspberry Pi yog tias koj nyiam.
Nrhiav rau pem hauv ntej kom nyeem koj!
Pom zoo:
Ua Koj Tus Kheej Spy Bug (Arduino Voice Recorder): 5 Kauj Ruam (nrog Duab)
Ua Koj Tus Kheej Spy Bug (Arduino Voice Recorder): Hauv qhov haujlwm no kuv yuav qhia koj li cas kuv ua ke Arduino Pro Mini nrog ob peb yam ntxiv ua ke txhawm rau tsim lub suab kaw uas tuaj yeem ua phem raws li tus neeg soj xyuas kab. Nws muaj sijhawm ua haujlwm nyob ib ncig ntawm 9 teev, yog qhov me me thiab yooj yim heev rau
Recorder Practice With Makey Makey: 7 Kauj Ruam (nrog Duab)
Recorder Practice With Makey Makey: Peb cov tub ntxhais kawm suab paj nruag yuav tsum ua tiav cov nkauj ntawm lub kaw suab kom tau txais txoj siv sia (daim ntawm cov xov paj dawb) kom txog thaum lawv ua tiav Txoj Cai Siv Dub. Qee zaum lawv muaj teeb meem nrog kev tso tus ntiv tes thiab "hnov" zaj nkauj los rau lub neej
Kev Tsim Qauv Duab Duab/Duab Duab Duab: 4 Kauj Ruam
Kev Tsim Qauv Duab Duab/Duab Duab Duab: Nyob zoo txhua tus, Hauv qhov kev qhia no, Kuv yuav qhia koj cov txheej txheem ntawm yuav ua li cas thiaj tsim 3D qauv siv cov duab digital. Cov txheej txheem hu ua Photogrammetry, tseem hu ua Image-Based Modeling (IBM). Tshwj xeeb, hom txheej txheem no tau siv los rov ua dua
Cov Duab Duab Duab thiab Cov Duab 1: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Cubes thiab Cov Duab 1: Thaum sim nrog qee cov ntoo ntoo thiab cov duab los qhia, kuv pom ob peb txoj hauv kev los ua cov voos thiab lwm yam duab los ntawm cov khoom siv yooj yim. Los ntawm kev muab cov no los ua Cov Ntawv Qhia, Kuv vam tias yuav txhawb nqa kev ua si thiab kev kawm. Kev hloov pauv ntawm qhov kev qhia no
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: Nov yog txoj hauv kev yooj yim heev thiab tus nqi qis mus rau cov duab thav duab digital - nrog qhov zoo ntawm kev ntxiv /tshem cov duab hla WiFi ntawm 'nyem thiab luag' siv (pub dawb) xa cov ntaub ntawv . Nws tuaj yeem siv tau los ntawm qhov me me £ 4.50 Pi Zero. Koj tseem tuaj yeem hloov pauv