Cov txheej txheem:
- Kauj Ruam 1: Kauj Ruam 1: Sib Sau Koj Qhov
- Kauj Ruam 2: Kauj Ruam 2: Txuas thiab Hluav Taws Xob
- Kauj Ruam 3: Kauj Ruam 3: Txheej Txheem Txheej Txheem Txheej Txheem Software
- Kauj Ruam 4: Kauj Ruam 4: Hloov kho JSON Configuration
Video: NHL Txaj Hockey Lub Teeb thiab LCD: 4 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
Taw qhia
"NHL Light" yog rau cov kiv cua hockey uas xav ua raws lawv pab neeg, tab sis tsis tuaj yeem saib txhua qhov kev ua si. Nws yog qhov zoo tshaj plaws yog tias nws ua piv txwv lub hom phiaj nrog lub hockey hockey (kev cai rau koj pab neeg), thiab lub teeb.
Ntxiv rau lub suab hockey thiab lub teeb, "NHL Light", muaj cov duab uas muab tam sim no, lossis qhov kev ua si tsis ntev los no cov qhab nia, sijhawm ua si lossis sijhawm ntawm kev ua si tom ntej, thiab hnub tim thiab sijhawm tam sim no.
"NHL Lub Teeb" sau rau ntawm cov npe yooj yim ntawm cov khoom, uas yooj yim rau sib dhos cov khoom siv hluav taws xob, thiab cov cai uas muaj pub dawb.
Nta
- Lub vev xaib raws kev teeb tsa rau xaiv koj pab neeg thiab wifi
- Ua lub teeb thiab suab nrov thaum koj pab pawg sib tw (txawm tias thaum koj yog pab neeg nyob deb)
- Plays suab tshaj tawm pib ntawm qhov kev ua si
- Plays lub suab tshaj tawm qhov xaus ntawm qhov kev ua si
- Muab sijhawm thiab hnub tim ntawm kev ua si tom ntej, yog tias tsis muaj kev ua si game.
- Qhia tawm lub sijhawm tam sim no thiab sijhawm, yog tias kev ua si tseem tab tom ua.
- Qhia hnub tim thiab sijhawm tam sim no.
Kauj Ruam 1: Kauj Ruam 1: Sib Sau Koj Qhov
Nov yog cov npe ntu.
-
Raspberry Pi W*
- Amazon
- Kuv nyiam kom tau txais kuv los ntawm Microcenter, tab sis tuaj yeem pom hauv online tsawg dua ntawm lwm qhov chaw.
- $10
- SD Card (4gb yam tsawg kawg nkaus)*
- hais lus - Amazon - ~ $ 2 *
- amp - PAM8403* - Amazon - ~ $ 1 txhua
- teeb - Amazon - ~ $ 5
-
Rooj plaub - $ 1*
- Michael tus
- Kuv pom zoo cov ntaub ntawv ntoo me me los ntawm Michael lub khw khoom siv tes ua, tab sis yuav tawm mus rau koj!
-
I2C 2004 LCD - $ 3-7
- Amazon
- Txoj cai txhawb nqa 3 hom LCD's, tab sis I2C 2004 yog qhov kuv tau txiav txim siab raws li tus nqi zoo tshaj plaws thiab qhov loj me. (SSD1306 kuj tseem tuaj yeem ua tau)
- 2 transistors - 2N2222A- Amazon
- Lwm Cov Hluav Taws Xob / solder12V
- fais fab mov - Amazon
- 12V -> 5V tus nqi hloov pauv - Amazon
*Muaj qhov hloov pauv thaum nws los txog rau xaiv qhov no.
NCO TSEG: Koj tuaj yeem pib ua rau feem ntau ntawm txoj haujlwm no nrog koj li Raspberry Pi xwb, thaum koj tos lwm yam khoom xa tuaj.
Kauj Ruam 2: Kauj Ruam 2: Txuas thiab Hluav Taws Xob
-
Sib Sau Teeb
- Kev txuas rau lub teeb yog kom khiav 12 + mus rau qhov pom kev.
- Khiav tsis zoo los ntawm lub teeb los ntawm ib qho ntawm cov transistors.
- Lub emmetter ntawm transistor mus rau hauv av.
- Tus neeg sau ntawm transistor mus rau Raspberry Pi.
-
Sib dhos suab
- Khiav txoj cai lossis sab laug suab los ntawm PI mus rau lub amp
- Khiav +5V rau lub amp
- Khiav amp av mus rau qhov thib ob transistor.
- Khiav lub emmetter ntawm 2nd transisitor rau hauv av
- Khiav tus sau ntawm transistor mus rau Raspberry Pi
- Sib dhos cov hlua rau PI
-
Nov yog cov lus qhia pinout rau PI (qee qhov no tau teeb tsa los ntawm JSON)
-
LCD
- 3 - SDA
- 5 - TSO
- 5 - VCC (+5)
- AMP 8 (GPIO 14)
- Teeb 10 (GPIO15)
- Suab Zoo - GPIO 18
-
Kauj Ruam 3: Kauj Ruam 3: Txheej Txheem Txheej Txheem Txheej Txheem Software
-
Npaj Raspberry Pi W.
- Rasberry pi yuav tsum tau khiav qhov tsis ntev los no ntawm Raspbian (lossis lwm yam Debian).
- Pom zoo kom ua raws cov lus qhia no:
- Nco ntsoov suav nrog wifi wpa_supplicant file.
- Muab cov ntaub ntawv ssh tso rau hauv sdcard kom tso cai ssh nkag mus.
-
Npaj cov software thib peb:
- Kuv tau siv cov txheej txheem no kom rub tag nrho cov cuab yeej xav tau thib peb, tab sis xav tias dawb los ua cov haujlwm no, thiab tshuaj xyuas kom paub tseeb tias tsis muaj cov kauj ruam ua tsis tiav.
- Rub tawm thiab khiav cov ntawv hauv qab no:
Nov yog kev rhuav tshem dab tsi ntawm cov ntawv teeb tsa rau teeb tsa lub operating system ua. Nws yog qhov zoo tshaj los khiav cov kab no ntawm tus kheej, yog li koj tuaj yeem saib rau qhov ua yuam kev.
Tsab ntawv Header:
#!/bin/sh -e #tuaj yeem hu los ntawm #curl -sL https://raw.githubusercontent.com/wga22/nodejs/ma… | sudo -E bash - # TODO: automate tsab ntawv no nrog qee yam xws li: curl -sL https://raw.githubusercontent.com/wga22/nodejs/ma… | sudo -E bash - # TODO: teeb tsa wifi # TODO: teeb tsa passwd thiab tso cai yuam sij # sau tseg:
Hloov kho software ntawm qib OS:
#apt-tau txais cov khoom (apt-tau hloov tshiab && apt-tau -y hloov kho)> /dev /null apt-tau txais deb-upgrade -y #General Dev apt-tau nruab -y git tsim-qhov tseem ceeb nab npawb-dev nab nab-pip nab hab sej-smbus libasound2-dev nodejs # GPIO apt-tau nruab -y raspi-gpio nab nab-duab python-smbus libasound2-dev #networking apt-tau nruab -y choj-utils hostapd dnsmasq apt-tau huv -y
Kev teeb tsa Networking. Ib feem ntawm lub hom phiaj ntawm no yog kom tso cai rau teeb tsa ntawm qhov chaw nkag, txuas rau koj tus kheej wifi, tab sis qhov no tseem tsis tau sim tag nrho tam sim no. Tam sim no pom zoo kom siv wpa_supplicant txoj hauv kev teeb tsa wifi.
#networking setupecho nhllight>/etc/hostname #TODO: txhim kho/etc/hosts #TODO: teeb tsa br0 mkdir/etc/hostapd/ #ceeb toom: lwm qhov teeb tsa tau ua tiav ntawm cov ntaub ntawv teeb tsa thiab plhaub rub tawm raws li ib feem ntawm qhov hloov tshiab
Hloov kho Node thiab node cov tsev qiv ntawv
#update nodecd/tmp export nodeversion = 8.9.0 #wget https://nodejs.org/dist/v7.4.0/node-v7.4.0-linux-… #wget https://nodejs.org/dist/v7. 4.0/node-v7.4.0-linux-… wget https://nodejs.org/dist/v7.4.0/node-v7.4.0-linux-… tar -xvf node-v $ {nodeversion} -linux-armv6l. tar.xz cd node-v $ {nodeversion} -linux-armv6l rm -f *.md rm -f LICENSE cp -R */usr/local/rm -R/tmp/node-v $ {nodeversion} -linux- armv6l rm /tmp/node-v${nodeversion}-linux-armv6l.tar.xz #TODO: ua sym txuas rau node binary? apt -tau tshem tawm -y --purge npm node nodejs
#Node teeb tsa mkdir/opt/nhl mkdir/opt/nhl/cav mkdir/opt/nhl/horns mkdir/opt/nhl/node_modules/
#hloov kho Node
#nruab node kev vam khom rau hauv nhl phau ntawv xa tawm NODE_PATH =/usr/local/lib/node_modules
#HACK - TODO - kho tus neeg ceg tawv uas tsis tuaj yeem teeb tsa thoob ntiaj teb
cd/opt/nhl npm install lame # lame, yog neeg ceg tawv, yuav tsis txhim kho thoob ntiaj teb cp -R/opt/nhl/node_modules/lame $ NODE_PATH npm nruab tus hais lus #wont nruab thoob ntiaj teb cp -R/opt/nhl/node_modules/hais lus $ NODE_PATH npm nruab i2c-bus #wont nruab thoob ntiaj teb cp -R/opt/nhl/node_modules/i2c-bus $ NODE_PATH npm nruab oled-i2c-bus #wont install globally cp -R/opt/nhl/node_modules/oled-i2c-bus $ NODE_PATH npm nruab lcd #wont nruab thoob ntiaj teb cp -R/opt/nhl/node_modules/lcd $ NODE_PATH npm nruab lcdi2c #wont nruab thoob ntiaj teb cp -R/opt/nhl/node_modules/lcdi2c $ NODE_PATH
npm nruab oled-font-5x7 #wont nruab thoob ntiaj teb
cp -R/opt/nhl/node_modules/oled-font-5x7 $ NODE_PATH
npm nruab onoff #yuav tsis nruab thoob ntiaj teb
cp -R/opt/nhl/node_modules/onoff $ NODE_PATH
#npm teeb tsa pm2 #yuav tsis nruab thoob ntiaj teb
#cp -R/opt/nhl/node_modules/pm2 $ NODE_PATH #npm install express #wont install globally #cp -R/opt/nhl/node_modules/express $ NODE_PATH
# ib qho qauv thoob ntiaj teb
npm nruab qhia lub cev -parser tus menyuam_process pm2 -g
Rub qhov tseeb code:
#pull git codecd/opt/nhl #JSON yog ib zaug tsim wget -tsis -cache -O /opt/nhl/nhl_config.json https://raw.githubusercontent.com/wga22/nodejs/ma… #wget -O /opt/nhl/NHL_work.js https://raw.githubusercontent.com/wga22/nodejs/ma… #call automated script to install everything else for NHL curl -sL https://raw.githubusercontent.com/wga22/nodejs /mav … | sudo -E tsoo -
Download tau lub suab!
#pull hornscd/opt/nhl/horns curl -sL https://raw.githubusercontent.com/wga22/nodejs/ma… | sudo -E tsoo -
hloov kho Raspberry pi cov ntaub ntawv teeb tsa - - yuav xav tau hloov pauv rau koj li kab ke
#config cov ntaub ntawv hloov tshiab#ntxiv suab cp /boot/config.txt /boot/config.txt.bak printf '\ ndtoverlay = pwm-2chan, pin = 18, func = 2, pin2 = 13, func2 = 4' >> / boot/config.txt #turn rau i2c printf '\ n / ndtparam = i2c1 = on / n' >> /boot /config.txt printf '\ n / ndtparam = i2c_arm = on / n' >>/boot/config. txt ua
#TODO: qhov no puas xav tau? Cp /etc /modules /etc/modules.bak printf '\ ni2c-dev / ni2c-bcm2708 / n' >> /etc /modules
amixer cset numid = 1
#TODO: teeb ntim, 60%?
Siv lub tshuab siv tshuab, xws li bootup thiab hloov kho cov cai:
# hloov tshiab rc.local# NCO TSEG: txav cov ntawv, vim tias ib tus qauv suav nrog "tawm" hauv kab kawg, yog li tsis tuaj yeem yooj yim ntxiv mv /etc/rc.local /etc/rc.local.bak kov /etc/rc.local chmod u+x /etc/rc.local printf '#!/bin/sh'> /etc/rc.local printf '\ n /etc/bootup_nhl.sh> /tmp/rclocal.log' >>/etc/rc.local printf '\ n tawm 0' >> /etc/rc.local
#TODO: xav tau ntxiv qee yam los ua qhov software hloov tshiab txhua lub lim tiam zoo li no# Tej zaum tsuas yog luam daim ntawv no ncaj qha mus rau rc.weekly nplaub tshev? rm /etc/cron.weekly/nhl_updater printf '#!/bin/sh / ncurl -sL https://raw.githubusercontent.com/wga22/nodejs/ma… | sudo -E bash -'> /etc/cron.weekly/nhl_updater chmod u+x /etc/cron.weekly/nhl_updater
Lwm yam khoom, xws li teeb tsa lub sijhawm sijhawm:
ln -sf/usr/qhia tawm/zoneinfo/America/New_York/etc/localtime
# hloov kho ib puag ncig sib txawv nrog node_path
cp/etc/environment /etc/environment.bak printf '\ nexport NODE_PATH =/usr/local/lib/node_modules / n' >>/etc/environment #TODO: txhais qhov no rau ntawm tus kheej.ipaddress = process.env. NODEJS_IP; #TODO: self.port = process.env. NODEJS_PORT || 80;
Siv PM2 rau kev teeb tsa tus neeg rau zaub mov:
#TODO: ntsuas teeb tsa PM2cd /tmp /npm nruab -g pm2 pm2 pib cd /opt /nhl pm2 pib NHL_work.js --node-args = "-max_old_space_size = 100 nthuav tawm-gc" pm2 pib webserver.js --node -args = "-max_old_space_size 100M" pm2 txuag pm2 pib tawm 0
Kauj Ruam 4: Kauj Ruam 4: Hloov kho JSON Configuration
Teeb koj cov ntaub ntawv teeb tsa JSON rau pab pawg koj nyiam, thiab lwm yam. Cov ntaub ntawv no nyob hauv /opt /nhl GO CAPITALS! config JSON cov ntaub ntawv
Lub software siv JSON cov ntaub ntawv los teeb tsa kho vajtse thiab pab pawg koj tab tom ua. Pab pawg tuaj yeem teeb tsa los ntawm lub vev xaib uas yuav ua haujlwm, tab sis kev teeb tsa kho vajtse xav tau teeb tsa tus kheej:
Nov yog kev piav qhia ntawm txhua tus nqi tau:
- myteam: qhov no yog 3 tsab ntawv ntawm pab pawg koj xav ua raws
- debug: Qhov muaj peev xwm ua tau yog 1 (tseeb) lossis 0 (cuav), thiab yuav tswj hwm kev txiav tawm ntau npaum li cas.
-
cov zis: qhov no yog cov txheej txheem uas cov qhab nia/cov ntsiab lus yuav tsum tau qhia. Qhov tseem ceeb yog:
- lcd: qhov no yog 2004 lcd
- console: qhov no yuav sau tsuas yog rau lub davhlau ya nyob twg (rau kev ua kab hais kom ua)
- oled: txhawb nqa rau SSD6404 oled zaub
-
teeb: muaj ob hom teeb pom kev zoo
- tswb: qhov no yuav tsav ib zaug GPIO rau kev qhib/tua lub transistor
- multi-led: txhawb nqa ntau xim, lossis ntau leds
- tsis muaj: tsis muaj lub teeb txuas
- amp: qhov no yog GPIO uas tsav lub transistor rau lub amp
Pom zoo:
Nyeem thiab Teeb Duab Lub Teeb thiab Kub Sensor Cov Ntaub Ntawv Nrog Raspberry Pi: 5 Cov Kauj Ruam
Nyeem thiab Teeb Duab Lub Teeb thiab Kub Sensor Cov Ntaub Ntawv Nrog Raspberry Pi: Hauv Cov Lus Qhia no koj yuav kawm paub yuav nyeem lub teeb thiab ntsuas kub li cas nrog raspberry pi thiab ADS1115 analog rau cov hloov pauv thiab teeb nws siv matplotlib. Cia pib nrog cov ntaub ntawv xav tau
Raspberry PI Lub Koob Yees Duab thiab Lub Teeb Tswj Lub Hnub Tuag: 5 Kauj Ruam (nrog Duab)
Raspberry PI Lub Koob Yees Duab thiab Lub Teeb Tswj Lub Hnub Qub: Raws li ib txwm kuv tab tom nrhiav tsim cov cuab yeej uas muaj txiaj ntsig, ua haujlwm ruaj khov thiab feem ntau yog txawm tias txhim kho piv rau tam sim no tawm ntawm lub txee daws teeb meem. Nov tseem yog lwm qhov haujlwm zoo, xub xub muaj npe Duab Ntxoo 0f Phoenix, Raspberry PI daim ntaub thaiv hauv
Lub laptop zoo dua rau lub txaj: 7 Kauj Ruam (nrog Duab)
Lub laptop zoo dua rau lub txaj: Ua kom yooj yim tab sis muaj txiaj ntsig zoo Laptop Stand rau ntawm $ 15 thiab 30-60 feeb! Zoo rau siv hauv txaj thaum ntaus ntawv, tshawb nrhiav, thiab tshwj xeeb tshaj yog saib cov yeeb yaj kiab. Thaum kuv siv kuv lub laptop hauv txaj, nws feem ntau tsis xis nyob. Kuv yuav tsum sib npaug lub laptop ntawm m
Cov Roj Teeb Lemon Me, thiab Lwm Cov Qauv rau Xoom Tus Nqi Hluav Taws Xob thiab Coj Lub Teeb Tsis Muaj Roj Teeb: 18 Kauj Ruam (nrog Duab)
Cov Roj Teeb Lemon Me, thiab Lwm Cov Qauv rau Xoom Tus Nqi Hluav Taws Xob thiab Coj Lub Teeb Tsis Muaj Roj Teeb: Nyob zoo, tej zaum koj twb paub txog txiv qaub roj teeb lossis roj teeb roj teeb. Lawv tau siv ib txwm siv rau lub hom phiaj kev kawm thiab lawv siv cov tshuaj tiv thaiv hluav taws xob uas tsim hluav taws xob qis, feem ntau pom nyob rau hauv daim ntawv ntawm cov coj lossis lub teeb ci ci. Cov no
Ib qho $ 20 / 20min Kev Lag Luam Zoo Folding Lub Teeb Lub Teeb / Lub Tsev Teeb: 7 Cov Kauj Ruam (nrog Duab)
A $ 20 / 20min Kev Lag Luam Zoo Folding Lub Teeb Lub Teeb / Lub Tsev Teeb: Yog tias koj tau tab tom nrhiav DIY lub thawv rau lub teeb rau cov khoom lag luam lossis kaw cov duab koj twb paub tias koj muaj ntau txoj kev xaiv. Los ntawm cov thawv ntawv thawv rau khaub ncaws hampers koj yuav xav tias txoj haujlwm tau ua tiav kom tuag. Tab sis Tos! Rau $ 20