Cov txheej txheem:

Duxman Teeb: 9 Kauj Ruam
Duxman Teeb: 9 Kauj Ruam

Video: Duxman Teeb: 9 Kauj Ruam

Video: Duxman Teeb: 9 Kauj Ruam
Video: Phauj Ntxawm tus txiv khav theeb. 9/24/2017 2024, Kaum ib hlis
Anonim
Image
Image

Lub hom phiaj tseem ceeb ntawm txoj haujlwm no yog txhawm rau ua kom pom lub teeb thiab lub suab. Koj tuaj yeem ua ke cov nkauj uas koj xav tau nrog lub teeb, piv txwv li koj lub Christmas lossis kho kom zoo nkauj los yog tog twg los xij. Hauv qhov no kuv muab koj piv txwv ntawm kuv lub sam thiaj nrog kho kom zoo nkauj Christmas, nrog LED kab txaij ntawm ntau xim thiab xaim.

Tam sim no kuv muab qee qhov txuas nrog piv txwv, thov txim tsis muaj suab tab sis koj tuaj yeem ntseeg kuv pob zeb Villancicos ua si

Nov yog qhov piv txwv 1

Nov yog qhov piv txwv 2

Kauj Ruam 1: Cov Cuab Yeej thiab Cov Khoom

Cov Cuab Yeej thiab Cov Khoom
Cov Cuab Yeej thiab Cov Khoom

Txog qhov kev qhia no koj xav tau qee cov ntaub ntawv (thov txim rau qhov no tab sis ntu no kuv xav sau hauv kuv hom lus, lus Mev)

  1. Vuam
  2. Tin
  3. Tus nqi tsis tau txiav txim siab ntawm 4 thiab 2 lub xov hlau (nyob ntawm qhov nrug koj xav npog), Kuv tau siv 15 meters
  4. Pom zoo vuam loupe
  5. Pom zoo xaim hluav taws xob lossis hluav taws xob txiab
  6. pom zoo crimper
  7. thiab ntawm chav kawm strips ntawm LEDs lossis ELWire
  8. Yog tias koj siv ELWire koj yuav xav tau ib lossis ntau tus neeg nqis peev
  9. Yog lawm, lub hwj chim 12V

Kuv tsis tuaj yeem qhia koj qhov tseeb tag nrho cov LEDs thiab theWire uas kuv tau siv thiab qhov twg kuv yuav nws, tab sis muaj ntau lub khw Suav zoo li (A _ _ Expre_ _) koj twb paub qhov twg tag nrho cov khoom siv no ntau dua lossis pheej yig.

Txhawm rau muab tswv yim rau koj txog yam kuv tau siv:

  • 15 meters ntawm ib xim LED (Liab, Ntsuab, Xiav) 5 meters txhua
  • 15 meter RGB coj
  • 25 metres ntawm cov hlau coj hlau ntawm adas (Kuv tsis paub yog vim li cas hauv Suav nplooj ntawv lawv hu nws li ntawd)
  • 100 meters ntawm ELWIRE ntawm cov xim sib txawv (Qhov no yog rub tawm nrog cov xim tsis raug Kuv tsis paub qhov twg kuv yuav lawv, kuv xav tias nws tau dhau los ntawm nplooj ntawv muag khoom (khom nqi)
  • 3 inverters los ntawm El xaim
  • 1 lub zog hluav taws xob ntawm 12 V (siv ib qho uas los nrog kuv lub tshuab luam ntawv 3d) tab sis hauv Amazon koj muaj ob peb, yog tias koj ua tsis tau, siv ATX lub zog xa khoom, koj tsuas xav tau me ntsis kev txawj
  • 15 Transistors Tswv Yim 120
  • 15 Kev Sib Txuas Clems
  • Tau kawg raspberry Pi 3 B +

Kauj Ruam 2: Vuam Cov Khoom thiab Koom Nrog Txhua Yam Khoom

Vuam Cov Khoom thiab Koom Nrog Txhua Yam Khoom
Vuam Cov Khoom thiab Koom Nrog Txhua Yam Khoom
Vuam Cov Khoom thiab Koom Nrog Txhua Yam Khoom
Vuam Cov Khoom thiab Koom Nrog Txhua Yam Khoom
Vuam Cov Khoom thiab Koom Nrog Txhua Yam Khoom
Vuam Cov Khoom thiab Koom Nrog Txhua Yam Khoom
Vuam Cov Khoom thiab Koom Nrog Txhua Yam Khoom
Vuam Cov Khoom thiab Koom Nrog Txhua Yam Khoom

Kuv tsis xav tias nws yog qhov yuav tsum tau piav qhia yuav ua li cas txhawm rau txhawm rau teeb lub LED los yog ElWire, vim tias nws tej zaum yuav qhib ntau yam lus qhia zoo dua li yuav ua li cas. ua tiav

Kuv tsuas yog xav hais tias kuv siv cov dej sib txuas rau txhua qhov kev sib txuas, muaj kev nyab xeeb zoo dua li thov txim.

Ob peb kauj ruam tom qab kuv tawm ntawm daim duab ntawm lub phaj yog tias koj xav siv lawv

Kauj Ruam 3: Siv Kuv Cov Khoom Tsim Kho, V1

Siv Kuv Cov Khoom Tsim Kho, V1
Siv Kuv Cov Khoom Tsim Kho, V1
Siv Kuv Cov Khoom Tsim Kho, V1
Siv Kuv Cov Khoom Tsim Kho, V1
Siv Kuv Cov Khoom Tsim Kho, V1
Siv Kuv Cov Khoom Tsim Kho, V1
Siv Kuv Cov Khoom Tsim Kho, V1
Siv Kuv Cov Khoom Tsim Kho, V1

Nov yog kuv thawj pawg thawj coj saib

Peb tuaj yeem tswj peb Zones lossis RGB coj sawb

Koj tsuas yog xav tau peb tus transsistor tip120 tus pin txuas thiab txuas txuas

Kauj Ruam 4: Siv Kuv Cov Khoos Phis Tawj Tsim, V2

Siv Kuv Cov Khoom Tsim Kho, V2
Siv Kuv Cov Khoom Tsim Kho, V2
Siv Kuv Cov Khoom Tsim Kho, V2
Siv Kuv Cov Khoom Tsim Kho, V2
Siv Kuv Cov Khoom Tsim Kho, V2
Siv Kuv Cov Khoom Tsim Kho, V2

Nov yog kuv pawg thawj coj thib ob

Peb tuaj yeem tswj tau 15 Zones Koj tsuas yog xav tau 15 tus transsistor tip120 tus lej sib txuas

Kauj Ruam 5: Npaj Koj Cov Raspberry

Kuv yuav tsis tawm tswv yim ntau txog cov kauj ruam no txij li twb muaj ntau cov lus qhia ntawm qhov no thiab kuv paub tseeb tias ib tus neeg yuav piav qhia lawv zoo dua kuv.

Koj tsuas yog yuav tsum tau teeb tsa qhov hloov tshiab kawg uas koj muaj raspbiam hauv koj li raspberry.

Koj yuav tsum tau teeb tsa qee pob khoom

Python xav tau

nruab cov pob hauv qab no

nab hab sej -m pipinstall numpy

nab hab sej -m pipinstall pyaudio

nab hab sej -m pipinstall pydub

Raspberry cov khoom

Tej zaum koj xav tau lwm pob khoom no

sudo apt-tau nruab git

sudo apt-tau nruab nruab sej-dev

sudo apt-tau nruab pyton-rpi.gpio

Kauj ruam 6: Tau txais Cov Version

Hauv qhov txuas hauv qab no koj tuaj yeem pom kuv tus lej, kuv xav tias koj yuav tsis nyiam nws, yog li tsis txiav koj tus kheej, koj tuaj yeem txhim kho nws.

github.com/duxman/lights

Xijpeem yog tias koj muaj lus pom thiab / lossis cov lus qhia tsis txhob yig tau hu rau kuv.

Tus thawj heev version

github.com/duxman/luces/releases/tag/Versi…

git clone

git checkout Version-0.01

Kev tso tawm thawj zaug, ua si Wav cov ntaub ntawv, Tsuas yog tso tawm digital

Qhov Thib Ob

github.com/duxman/luces/releases/tag/Versi…

git clone https://github.com/duxman/luces.gitgit checkout Version-0.02

Nws tso cai rau kev rov tsim dua ntawm wav thiab mp3 (cov no yuav dhau los ua thawj hauv kev tsim dua tshiab) Cov ntawv sib cais tau tsim los tso cai ua suab paj nruag thiab ua ntu zus

Lub vev xaib teeb tsa tau yoog raws

Txhim kho playback thiab synchronization

Tam sim no thaj chaw teeb pom kev zoo tau txhais tsis yog tus lej tus kheej, txhua thaj tsam tso cai rau ntau tus pin.

Txoj kev txhim kho

github.com/duxman/luces

git clone

Kuv txhim kho de code

Kuv tabtom txhim kho txoj cai thiab muab cov yam ntxwv tshiab, tab sis nws yuav tsis ruaj khov. Koj paub tias koj ua dab tsi

Kauj Ruam 7: Kho Txhua Tus Ua Ke

Kho Txhua Tus Ua Ke
Kho Txhua Tus Ua Ke
Kho Txhua Tus Ua Ke
Kho Txhua Tus Ua Ke
Kho Txhua Tus Ua Ke
Kho Txhua Tus Ua Ke

Lus Duxman

Xav paub ntau ntxiv y blog

duxnet.es/luces/

Nruab download lub chaw cia khoom

duxnet.es/luces/

nruab cov pob hauv qab no

nab hab sej -m pipinstall numpy

nab hab sej -m pipinstall pyaudio

nab hab sej -m pipinstall pydub

Txhawm rau siv nrog MP3 cov ntaub ntawv koj xav tau ffmepg teeb tsa hauv koj lub kaw lus kom ntseeg tau tias koj muaj ffmpeg thiab ffprobe hauv koj txoj kev ua tiav

Kho

Hloov kho cov ntaub ntawv hauv qab no hauv kab ntawv teeb tsa lossis siv lub vev xaib uas suav nrog hauv app los ntawm lub neej ntawd hauv chaw nres nkoj 8000

Koj tsuas yog neeed mus rau https://: 8000 thiab pib lom zem:)

configuration.json

Nws yog kev teeb tsa dav dav ntawm qhov program Cov ntaub ntawv no muaj

"GeneralPins": Cov teeb tsa dav dav (tsis siv) "MusicPath": Cov npe nkauj "FfmpegPath": txoj kev ffmpeg, tsuas yog rau lub qhov rais, "WebServerPort": lub vev xaib chaw nres nkoj

programacion.json

Nws yog lub sijhawm teeb tsa ntawm qhov haujlwm Cov ntaub ntawv no muaj

"Pib Sijhawm": Pib Sijhawm, "Xeem Sijhawm": Sijhawm Kawg "Xeev": Tsis siv "Tos Sijhawm": Tos Sijhawm ntawm kev ua tiav

ProgramConfiguration.json

Hauv cov ntaub ntawv no peb teeb tsa cov nkauj ua suab paj nruag lossis kab sib lawv liag

Cov ntaub ntawv no muaj

"ProgramName": Lub npe program "ProgramType": Qhia yog tias txoj haujlwm siv suab paj nruag o programed sequences SEQ -> Execute Secuence MUSIC -> ua tiav nrog cov ntaub ntawv suab paj nruag "ProgramInterval": Tos sijhawm ntawm kev ua tiav "Sequences": Array of Zones qhib

"MusicFiles": Tshaj tawm cov nkauj wav lossis cov ntaub ntawv mp3 Cov ntaub ntawv mp3 yuav hloov pauv mus rau wav thawj zaug peb ua si. Zones.json

Hauv cov ntawv no peb teeb tsa thaj tsam ua ntej nrog cov pins siv hauv txhua cheeb tsam

Cov ntaub ntawv no muaj

"ZoneType": Nws yog GPIO lossis MCP (yog tias peb siv MCP peb yuav tsum teeb tsa I2CConfig.json file) "Zones": Array of Zones [ZoneId: nws yog qhov hnyav lossis qhov kev txiav txim ntawm cheeb tsam ZoneName: Lub npe ntawm cheeb tsam ZonePins: Comma cais cov hlua nrog cov pins siv hauv cheeb tsam no ZoneType: Qhia yog thaj tsam teeb ib leeg lossis hauv hom spectrum. Nws muaj txiaj ntsig zoo los hais txog thaj tsam tshwj xeeb] I2CConfig.json

Hauv cov ntawv no peb teeb tsa I2CDevices Kuv siv MCP23016 chaw nres nkoj nthuav dav

Cov ntaub ntawv no muaj

"Devices": Cov cuab yeej ntawm cov khoom [BasePin: Tus lej tus lej pib rau I2C Device, ua li no nrog MCP nws yog thawj tus lej digital hauv MCP I2CAddress: Chaw nyob ntawm MCP ntaus ntawv]

Kauj Ruam 8: Ua Haujlwm Cov Haujlwm

Txhawm rau siv txoj haujlwm tseem ceeb ua tiav

cov lus txib no

sudo python luces/main.py

Txhawm rau sim ib zaj nkauj ua raws cov lus txib no

sudo python luces/PlayMusic.py -i piv txwv: sudo python luces/PlayMusic.py -i./music/sample.wav

Rau kev sim ua Sequence ua cov lus txib no

sudo python luces/PlaySequence.py -i piv txwv: sudo python luces/PlaySequence.py -i 1, 3, 1, 4, 2, 1, 5, 2, 3, 4, 5

Hloov mp3 rau wav

sudo python luces/util/Mp3ToWav.py -i -p piv txwv: sudo python luces/PlaySequence.py -i sample.mp3 -p../music

koj yuav tau txais../music/sample.mp3.wav

Kauj Ruam 9: Qhov Kawg

Image
Image

Qhov no yog qhov kawg.

Kuv tsis tuaj yeem hnov lub suab nkauj, snifffff, tab sis kuv tsis qhia kuv tus kheej. Muab tso rau pob zeb hu nkauj nrog cov kws ua yeeb yam zoo li (MotoHead, Poj huab tais, Bruce Sprint, Ramones, Twisted Muam, thiab ntau dua) Tab sis koj tuaj yeem tsim lub teeb nyob rau hauv cov suab paj nruag.

Pom zoo: