Cov txheej txheem:

Lub Juke Box rau Cov Hluas Heev Aka Raspi-Music-Box: 5 Kauj Ruam
Lub Juke Box rau Cov Hluas Heev Aka Raspi-Music-Box: 5 Kauj Ruam

Video: Lub Juke Box rau Cov Hluas Heev Aka Raspi-Music-Box: 5 Kauj Ruam

Video: Lub Juke Box rau Cov Hluas Heev Aka Raspi-Music-Box: 5 Kauj Ruam
Video: It Became Unliveable! ~ Abandoned Home Of The Spenser's In The USA 2024, Kaum ib hlis
Anonim
Lub Juke Box rau Cov Hluas Heev… Aka Raspi-Music-Box
Lub Juke Box rau Cov Hluas Heev… Aka Raspi-Music-Box

Kev tshoov siab los ntawm kev qhia "Raspberry-Pi-based-RFID-Music-Robot" piav qhia lub suab paj nruag neeg uas ua ntawv ROALDH tsim rau nws hnub nyoog 3 xyoos, Kuv txiav txim siab los tsim lub thawv rau menyuam yaus rau kuv cov menyuam yaus. Nws yog lub hauv paus ib lub thawv nrog 16 cov nyees khawm thiab Raspi 2 sab hauv uas ua nkauj nkauj ntawm lub tso suab txuas thaum twg los xij ntawm cov nyees khawm raug nias.

Koj xav tau dab tsi:

  • Raspberry Pi nrog lub hwj chim
  • 16 cov nyees khawm - yam uas raug kaw ib ntus thaum thawb (lossis txawm li cas los xij ntau lub khawm uas koj xav tau - qhia: tsis ntau dua li koj muaj tus lej nkag…;)) Kuv siv qhov no: khawm rau 50 0.50)
  • qee cov xov hlau nyias
  • ib 10kOhm thiab ib qho 1kOhm resister ib lub pob (tshwj tsis yog tias koj xav tso siab rau sab hauv rub-nce/nqis resistors ntawm Raspi, tom qab ntawd koj tuaj yeem hla qhov no)
  • daim kab xev
  • poj niam lub taub hau (2x20 tus pin)
  • qee cov ntoo nyias los tsim lub thawv (Kuv siv 2 nplooj ntawv 5x400x400mm rau sab xub ntiag thiab sab nraub qaum ntxiv rau 2000x50x5mm kab txaij txiav ob sab los ntawm)
  • 24 tus ntsia hlau thiab cov kua nplaum me me los tso lub thawv ua ke
  • qee cov xim kom nws muaj xim zoo nkauj
  • lub suab txuas txuas Raspi rau koj lub tso suab lossis hais lus nquag (txuas rau txhua yam koj xav tau ntawm lwm qhov kawg)
  • cov cuab yeej: cov hlau txuas, hlau clippers, hlau stripper hom phiaj, pom, laum, ntsia hlau tsav tsheb, txhuam …
  • xaiv tau: USB Sound Card yog tias koj xav kom lub suab nkauj nrov zoo
  • xaiv tau: daim npav wifi yog tias koj xav txuas rau Raspi qub yam tsis tau qhib lub thawv

Thov nco ntsoov tias qhov no yog kuv thawj qhov kev qhia thiab kuv tau ua txoj haujlwm no ib pliag dhau los … Kuv tau ua nws raws li kuv tau nug txog VLC txoj hauv kev ua cov nkauj hauv cov lus pom ntawm cov lus qhia tau hais los saum no (mplayer siv nyob ntawd yog tsis txhawb ntxiv raws li kuv paub). Kuv paub cov lus qhia no tsis zoo heev, tab sis vam tias nws tuaj yeem ua rau koj ua raws … yog tias tsis yog, thov tseem saib cov lus qhia qub thiab thov tawm cov lus hauv qab no qhia kuv qhov twg koj tau daig … Kuv mam li sim ua kom zoo dua …

Kauj Ruam 1: Tsim Lub Thawv…

Tsim ib lub thawv…
Tsim ib lub thawv…
Tsim ib lub thawv…
Tsim ib lub thawv…

Yog li thawj qhov koj yuav tsum tau ua yog tsim lub npov … Kuv ua rau kuv loj heev vim tias kuv tau tso qee qhov chaw hauv qab txhua khawm rau daim ntawv lo … Kuv npaj yuav luam tawm qee cov duab rau txhua zaj nkauj, laminate lawv tej zaum thiab xiav tag lawv hauv qab cov nyees khawm… kawm paub: los ntawm lub sijhawm koj luam cov ntawv, koj cov menyuam paub txhua zaj nkauj los ntawm qhov nyuaj thiab xav kom koj hloov qee yam… Yog li lwm zaus kuv yuav tsim lub thawv me me thiab muab cov nyees khawm ze ua ke…

Yog li, rov qab mus rau kuv lub npov … Kuv yuav ob daim plywood 400 x 400 x 5 mm thiab ib daim kab xev 2000 x 50 x 5 mm … tom qab thawj zaug, cov kauj ruam tseem ceeb tshaj plaws: kuv tus ntxhais tau tso cai pleev xim rau pem hauv ntej hauv nws qhov kev xaiv xim …:) Thaum nws tab tom pleev xim kuv txiav qhov ntev me me rau hauv 5 daim kab xev - ob 400 mm ntev, ob qho 390 mm ntev thiab cov laug sab laug …;) cov no kuv glued rau sab nraum qab ntawm cov ntawv pleev xim tshiab … tom qab ntawd kuv tau hlais 12 qhov los ntawm sab nraud thiab ntsia hlau hauv 12 tus ntsia hlau … Kuv tom qab ua tib zoo sib dhos rau lwm daim ntawv nyob tom qab, drilled lwm 12 qhov rau ntxiv 12 screws kom kaw lub thawv thaum kuv ua tiav. (Kuv paub 12 tus ntsia hlau yuav ua rau me ntsis dhau tab sis cov menyuam muaj zog…:))

Ntawm ib sab kuv tau siv cov ntaub ntawv (koj tuaj yeem siv dremel kom nrawm dua) kom txiav ntoo me ntsis kom hla cov kab hluav taws xob. Tom qab ntawd kuv tseem tau tho qhov rau 16 khawm thiab teeb tsa lawv.

Kauj Ruam 2: Txhim Kho Cov Khawm

Xaim Cov Khawm
Xaim Cov Khawm

Yog li tam sim no koj tau txais ib lub thawv nrog 16 lub pob… tom ntej no koj yuav tsum xaim cov no… Kuv txuas ib qho ntawm lawv tus ncej rau hauv av hauv daisy saw zam. Qhov zoo tshaj koj yuav muaj cov txuas me me los ua li ntawd … Kuv tau siv lawv rau, uas yog npau suav phem loj thiab yuav ua rau muaj teeb meem ntau dua yog tias kuv ib txwm yuav tsum tau siv cov nyees khawm tawm. Tom qab ntawd kuv txuas lawv lwm tus ncej rau xaim liab txhua qhov … Cov no kuv tau muab txuas rau lub rooj sib txuas uas koj tuaj yeem pom dag hauv nruab nrab …

Lub pob twg rau tus pin twg? Khawm 1-16 hauv qhov kev txiav txim no: GPIO 18. 27, 17, 04, 23, 24, 22, 05, 16, 12, 06, 13, 21, 20, 19, 26. Thov txheeb xyuas qhov "ntes khawm xov xwm ntu "hauv cov cai tom qab.

(Thov tsis txhob nug kuv dab tsi yog cov xaim xaim xaim rau … Kuv nco tsis tau)

Kauj Ruam 3: Tsis teb los tau: Ua lub Rooj Tswjhwm Saib Nrog Rub Tawm thiab Rub Tawm Cov Tiv Thaiv

Yeem: Ua Lub Rooj Tsav Xwm Nrog Rub Tawm thiab Rub Tawm Cov Neeg Tiv Thaiv
Yeem: Ua Lub Rooj Tsav Xwm Nrog Rub Tawm thiab Rub Tawm Cov Neeg Tiv Thaiv
Yeem: Ua Lub Rooj Tsav Xwm Nrog Rub Tawm thiab Rub Tawm Cov Neeg Tiv Thaiv
Yeem: Ua Lub Rooj Tsav Xwm Nrog Rub Tawm thiab Rub Tawm Cov Neeg Tiv Thaiv

Yog tias koj tsis paub meej tias rub dab tsi thiab rub cov resistors yog dab tsi, koj yuav tsum yooj yim pom cov ntaub ntawv hauv online. Cov raspi muaj qee qhov ua hauv lossis koj tuaj yeem ua sab nraud ib yam li kuv tau ua ntawm no. Cov kauj ruam no yog xaiv tau raws li kuv tsis xav tias koj xav tau tiag tiag.

Yog li vim li cas kuv thiaj ua nws? Qee zaum cov nkauj pib ua si thaum kuv qhib/tua cov khoom siv hauv tsev. Kuv xub xav tias nws tau khaws hluav taws xob sib nqus lossis lwm yam. Yog li kuv tau ntxiv qhov rub tawm/nqis resistors … Raws li qhov no tsis tau txhim kho qhov xwm txheej, Kuv tau ntxiv qee qhov capacitors ntxiv rau. Qhov no tseem tsis tau pab … yam tom ntej uas kuv xav sim yog npog sab hauv lub thawv nrog cov ntawv ci txhuas kom tiv thaiv. Raws li qhov teeb meem nres thaum peb tsiv tsev, Kuv yeej tsis tau sim qhov no … Yog li dab tsi yog qhov teeb meem? Kuv tsis paub … nws yuav yog qhov hloov pauv ntawm cov kab hluav taws xob?

Xaus: Kuv yuav qhia koj ua ntej tsuas yog txuas cov nyees khawm ncaj qha (koj yuav pom hauv cov cai tom qab uas khawm mus rau tus lej twg) thiab tsuas yog ua cov kauj ruam no yog tias koj muaj qee qhov teeb meem. Kuv vam tias koj tuaj yeem pom los ntawm cov duab saum toj no kuv tau ua li cas. Yeej muaj ib kab rau muab tso rau ntawm lub taub hau hauv nruab nrab thiab tom qab ntawd ntawm txhua sab kuv txuas ob lub resistors thiab cov xov txuas los ntawm cov nyees khawm hauv ib kab.

Kauj Ruam 4: Tus Python Code

Nrog rau ntawm no koj yuav pom cov cai (hauv nab hab sej) uas tswj lub suab paj nruag. Kuv ntxiv ob peb cov lus yog li vam tias nws yog tus kheej piav qhia. Tsuas yog nyob ntawm no piav qhia sai. Nws yog qhov zoo tshaj los pib nyeem cov ntawv hloov pauv nyob rau sab saum toj thiab tom qab ntawd hla txhua txoj hauv kev mus rau hauv qab.

Hauv qab koj yuav pom lub voj, uas khiav txhua lub sijhawm. Nws xub txheeb xyuas seb puas muaj qee ntu ntawm cov nyees khawm tau nias - qhov no yog kuv li kev siv qee qhov kev tswj hwm niam txiv. Tom qab ntawd muaj cov haujlwm uas ua suab paj nruag.

Saum toj no lub voj tseem ceeb koj yuav pom qee qhov xwm txheej pom - cov no tau ua tiav yog tias ib qho ntawm cov nyees khawm raug nias. Txhua lub pob hu ua ButtonPress muaj nuj nqi hla tus cim.

Yog li yuav ua li cas kom nws ua suab paj nruag? Txhawm rau ua kom yooj yim, Kuv tsuas yog tsim ib daim nplaub tshev rau txhua khawm. Xijpeem mp3s koj muab tso rau hauv cov ntawv no, ua haujlwm ntxiv rau cov npe ua si.

Thov nco tseg, yog tias koj tsis siv lub cev rub cov neeg tawm tsam, koj yuav tsum hloov ntu nrog BCM tus lej rau qhov no:

# teeb tsa siv BCM tus lej GPIO.setmode (GPIO. BCM) GPIO.setup (04, GPIO. IN, rub_up_down = GPIO. PUD_UP) GPIO.setup (17, GPIO. IN, rub_up_down = GPIO. PUD_UP) GPIO.setup (27, GPIO. IN, rub_up_down = GPIO. PUD_UP) GPIO.setup (22, GPIO. IN, rub_up_down = GPIO. PUD_UP) GPIO.setup (05, GPIO. IN, rub_up_down = GPIO. PUD_UP) GPIO.setup (06, GPIO. IN, rub_up_down = GPIO. PUD_UP) GPIO.setup (13, GPIO. IN, rub_up_down = GPIO. PUD_UP) GPIO.setup (19, GPIO. IN, pull_up_down = GPIO. PUD_UP) GPIO.setup (26, GPIO. IN, pull_up_down = GPIO. PUD_UP) GPIO.setup (18, GPIO. IN, pull_up_down = GPIO. PUD_UP) GPIO.setup (23, GPIO. IN, pull_up_down = GPIO. PUD_UP) GPIO.setup (24, GPIO. IN, pull_up_down = GPIO. PUD_UP) GPIO.setup (12, GPIO. IN, pull_up_down = GPIO. PUD_UP) GPIO.setup (16, GPIO. IN, pull_up_down = GPIO. PUD_UP) GPIO.setup (20, GPIO. IN, pull_up_down = GPIO. PUD_UP) GPIO.setup (21, GPIO. IN, rub_up_down = GPIO. PUD_UP)

Kauj Ruam 5: Teeb Koj Li Rapsi

Koj kuj tseem yuav tsum teeb tsa raspi tau kawg … Kuv tsuas yog siv tus qauv Noop teeb tsa. Kuv paub tseeb tias koj yuav pom ntau cov lus qhia yuav ua li cas…

Txhawm rau siv nab hab sej koj yuav tsum tau "sudo apt-get install python-dev"

Kuv qhov program siv VLC los ua suab paj nruag:

  • Kuv tau txais Python kev sib txuas los ntawm no (vam tias qhov no tseem muaj qhov tshiab):
  • Tom qab ntawd kuv tau teeb tsa nws siv "sudo python setup.py install"
  • Tom qab ntawd teeb tsa VLC "sudo apt-tau nruab vlc"
  • Khaws cov ntaub ntawv vlc.py thiab vlc.pyc rau hauv cov npe tib yam li koj qhov program
  • Xav paub ntau ntxiv ntawm

Kuv cov ntawv hais tias koj kuj yuav tsum tau teeb tsa cov hauv qab no txhawm rau nkag mus rau GPIO Pins los ntawm nab hab sej (tab sis qhov no yuav tsis dhau hnub):

  • wget https://www.airspayce.com/mikem/bcm2835/bcm2835-1…. zxvf bcm2835-1.xx.tar.gz
  • cd bcm2835-1.xx
  • ./configure
  • ua
  • sudo ua daim tshev
  • sudo ua kom nruab

Txhawm rau ua kom koj cov haujlwm ua haujlwm, koj yuav tsum tau hu "sudo python yourfilename.py".

Pom zoo: