Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Luam Ntawv 3D
- Kauj ruam 2: Circuit Court
- Kauj Ruam 3: Npaj Raspberry Pi
- Kauj ruam 4: Txoj Cai
- Kauj Ruam 5: Muab Nws Txhua Qhov Ua Ke
- Kauj Ruam 6: Ib Xyoo Tom Qab …
Video: Me Nyuam Kev Kawm Caij Nyoog: 6 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
Kuv xav tau lub moos los pab kuv tus menyuam hnub nyoog 4 xyoos kawm kom tsaug zog me ntsis ntxiv (Kuv tau muaj txaus kom sawv thaum 5:30 sawv ntxov thaum hnub Saturday), tab sis lawv tseem nyeem sijhawm tsis tau. Tom qab tshawb nrhiav los ntawm ob peb yam khoom ntawm lub vev xaib uas muaj neeg nyiam heev, kuv xav tias, "Yuav nyuaj npaum li cas thiaj li yuav tsum tau ua ib qho?!"
Yog li ntawm no yog qhov kuv xav tias kuv xav tau hauv qhov haujlwm no. Nws yuav siv qee qhov RGB LED's (feem ntau vim tias kuv muaj txog tsib caug ntawm lawv los ntawm lwm qhov haujlwm) los tso saib peb xim sib txawv. Liab yuav txhais tau tias rov qab mus pw, nws ntxov dhau rau sawv ntxov. Daj yuav txhais tau tias lawv tuaj yeem sawv thiab ua si ntsiag to hauv lawv chav. Ntsuab, tau kawg txhais tau tias koj tuaj yeem sawv. Kuv kuj xav kom tuaj yeem kho lub sijhawm, vim tias kuv xav pw ntev dua ntawm qee hnub (Hnub so/Hnub so vs Hnub Ua Haujlwm thiab lwm yam).
Khoom siv
Raspberry Pi Zero W.
Ob RGB LEDs
Rau 220 Ohm resistor's
Cov ntaub ntawv (.stl, nab hab sej, html) pom ntawm no
Ntau yam ntsia hlau me me, xov hlau, thiab ntu me me raws li xav tau.
Kauj Ruam 1: Luam Ntawv 3D
Kuv tus ntxhais zoo li unicorns tiag tiag, yog li rau qhov haujlwm no kuv tau kho dua Riven02's Unicorn Nightlight, uas yog nkauj tshiab ntawm Apachcreation's Unicorn Trophy, uas tuaj yeem pom ntawm Thingiverse.com thiab siv raws li Creative Commons Non-Commercial licence. Kuv hloov kho unicorn puag kom haum rau lub hwj chim qaum rau raspberry pi xoom. Kuv tau tshwm sim kom muaj qee qhov AMZ3D Liab PLA tso ncig, yog li lub hauv paus thiab lub taub hau yuav liab. Kuv siv PLA meej/txhais tau zoo rau lub suab raj. Cov ntaub ntawv.stl thiab cov chaw kuv siv yog:
Unicorn.stl
- Txheej siab: 0.02
- Phab ntsa Thickness:.8
- Phab Ntsa Kab Suav: 2
- Tus nqi: 15%
- Txawv Txawv Txawv: Daim phiaj
UnicornBase.stl
- Txheej siab: 0.02
- Phab ntsa Thickness:.8
- Phab Ntsa Kab Suav: 2
- Tus nqi: 15%
- Txawv Txawv Txawv: Daim phiaj
Horn.stl
- Txheej siab: 0.02
- Phab ntsa Thickness: 0.8
- Phab Ntsa Kab Suav: 3
- Cov ntaub ntawv: 0
Kauj ruam 2: Circuit Court
Lub voj voog yog yooj yim zoo nkauj. Kuv xaiv rau 6 tus GPIO sib txawv los tswj qhov qhib/tawm rau cov xim sib txawv ntawm RGB. Cov pins thiab cov xim sib xws LED yog:
- Pin 11 rau RGB 1 RED
- Pin 13 rau RGB 1 GREEN
- Pin 15 rau RGB 1 XOV XWM
- Pin 16 rau RGB 2 RED
- Pin 18 rau RGB 2 GREEN
- Pin 36 rau RGB 2 XIAV
- Pin 39 rau hauv av
Txhua tus pin tau txuas rau tus tiv thaiv los ntawm 220 ohm tam sim no txwv kev tiv thaiv (nrog rau qhov tshwj xeeb hauv av ntawm chav kawm.) Kuv tau siv tus tiv thaiv kab hauv kab thiab npog nws nrog cua sov ntsws tubing.
Kauj Ruam 3: Npaj Raspberry Pi
Kuv xav kom tuaj yeem teev sijhawm rau tus kws qhia pw tsaug zog siv lub web interface. Yog li kuv xav tau teeb tsa Apache thiab PHP Server ntawm Raspberry Pi. Thawj qhov uas koj yuav tsum ib txwm ua thaum txhim kho software tshiab ntawm Raspberry Pi yog kom paub tseeb tias nws tau hloov kho tshiab los ntawm kev ntaus:
sudo apt-tau hloov tshiab
Tom qab ntawd, peb tuaj yeem nqis mus ua lag luam. Peb yuav ua qhov ntawd los ntawm kev txhim kho Apache2:
sudo apt -tau nruab apache2 -y
qhov no yuav tsum teeb tsa Apache web server. Koj tuaj yeem sim qhov no los ntawm kev siv browser ntawm Raspberry pi thiab mus rau:
zos/
lossis los ntawm kev tshawb nrhiav los ntawm lwm lub khoos phis tawj browser mus rau koj li Raspberry Pi tus IP chaw nyob. Txhawm rau nrhiav koj tus IP chaw nyob hom:
hostname -Ib
Ua cov no yuav ua rau lub neej ntawd Apache Web Server nplooj ntawv. Qhov no tuaj yeem hloov pauv los ntawm kev hloov pauv index.html nyob hauv/var/www/html/directory. Nws tuaj yeem hloov nws nrog kuv tus kheej cov ntawv index.html.
Tom ntej no peb yuav teeb tsa Apache lub web server kom tuaj yeem khiav cov ntaub ntawv PHP. Pib los ntawm kev ntaus ntawv:
sudo apt-tau nruab php libapache2-mod-php -y
koj yuav tsum tam sim no tuaj yeem tso cov ntaub ntawv sleepset.php hauv/var/www/html nrog cov ntawv index.html.
Txhawm rau kom nkag mus rau nplooj ntawv no hauv koj tus kheej lub network, koj yuav tsum teeb tsa koj li Raspberry Pi nrog tus IP chaw nyob zoo li qub (lossis koj tuaj yeem tsuas yog sim txiav txim siab tus IP tshiab thaum koj lub network txuas ntxiv nws tam sim no thiab tom qab ntawd). Koj yuav tsum tau kho ob peb cov ntaub ntawv kom qhov no ua haujlwm. Koj yuav tsum tau kho cov ntaub ntawv /etc/dhcpcd.conf nrog cov hauv qab no:
wb wl0
zoo li qub ip_address = 192.168.1.static routers = 192.168.1.1 zoo li qub domain_name_servers = 192.168.1.1
Hloov nrog koj cov ntaub ntawv network. Tib yam uas koj yuav tsum tau ua tam sim no yog rov pib dua.
sudo rov pib dua
Kev tso cov ntaub ntawv los ntawm Google txuas txuas yuav tsum yog raws li hauv qab no:
- index.html thiab sleepset.php yuav tsum tau muab tso rau hauv/var/www/html directory
- sleepset.txt thiab sleeptrainer1_1.py yuav tsum tau muab tso rau hauv/home/pi/pythoncode directory (hint: koj yuav tau tsim cov npe no)
Tom qab tso cov ntaub ntawv no rau hauv phau ntawv qhia raug, rc.local cov ntaub ntawv xav tau hloov kho kom ua haujlwm sleeptrainer1_1.py program thaum pib. Koj yuav xav tau cov hauv paus-qib nkag mus hloov rc.local cov ntaub ntawv, yog li ntaus:
sudo nano /etc/rc.local
Hauv tus khoos phis tawj, nqes mus, thiab tsuas yog ua ntej txoj kab 0 tawm, ntxiv:
nab hab sej /home/pi/pythoncode/sleeptrainer1_1.py &
Muaj ob yam yuav tsum nco ntsoov ntawm no:
- Siv cov ntaub ntawv tsis tseeb kom LINUX tsis xav tias cov ntaub ntawv sleeptraner1_1.py nyob hauv tib phau ntawv teev npe li rc.local.
- Tsis txhob hnov qab tus ampersand (&) thaum kawg. qhov no yuav tso cai rau LINUX los khiav cov ntaub ntawv no hauv keeb kwm yav dhau thiab txuas ntxiv mus.
Tam sim no, khaws cov ntawv los ntawm kev ntaus ctrl-x thiab tom qab ntawd y thaum hais kom txuag thiab tom qab ntawd nkag mus.
Tom qab ntawv ntaus sudo reboot.
Nws yuav tsum tau hais txog qee qhov ntawm no uas (tsawg kawg) koj yuav tsum hloov koj li Raspberry Pi lo lus zais siv tus passwd hais kom ua. Yog tias koj tseem tsis tau ua qhov no, tam sim no yuav yog lub sijhawm zoo.
Kauj ruam 4: Txoj Cai
Cov hauv qab no yog cov cai los ntawm cov ntaub ntawv sleeptrainer1_1.py. Kuv siv lub sijhawm kwv yees los sib piv lub sijhawm rau cov nyeem hauv cov ntaub ntawv sleepset.txt. Cov ntawv sau tsuas yog ob kab, thawj rau teev, thib ob rau feeb. sleeptrainer1_1.py pw rau ib feeb ntawm lub voj iterations kom tsis khi cov txheej txheem. Lub teeb ntsuab tau pib tawm los zoo li ci ntsa iab, yog li kuv siv qhov ntsuas qhov dav ntawm tes taws los piav kom dim thaum siv nrog liab los ua daj.
Nab hab sej code:
ntshuam RPi. GPIO ua GPIO
los ntawm hnub tim ntshuam datetime raws li dt lub sijhawm ntshuam GPIO.setmode (GPIO. BOARD) GPIO.setwarnings (Cuav) red1 = 11 red2 = 16 green1 = 13 green2 = 18 blue1 = 15 blue2 = 36 GPIO.setup (red1, GPIO. OUT) GPIO.setup (red2, GPIO. OUT) GPIO.setup (ntsuab 1, GPIO. OUT) GPIO.setup (ntsuab2, GPIO. OUT) GPIO.setup (blue1, GPIO. OUT) GPIO.setup (blue2, GPIO. OUT) p1 = GPIO. PWM (ntsuab1, 100) p2 = GPIO. PWM (ntsuab2, 100) def readset (): setfile = qhib ("/home/pi/pythoncode/sleepset.txt", 'r') a = setfile. readline () b = setfile.readline () a = int (a) b = int (b) rov qab a, b def coj teeb (xim): yog tias (xim == "liab"): GPIO.output (red1, GPIO. HIGH) GPIO.output (red2, GPIO. HIGH) p1.stop () p2.stop () GPIO.output (blue1, GPIO. LOW) GPIO.output (blue2, GPIO. LOW) elif (xim == "xiav"): GPIO.output (red1, GPIO. LOW) GPIO.output (red2, GPIO. LOW) p1.stop () p2.stop () GPIO.output (blue1, GPIO. HIGH) GPIO.output (blue2, GPIO. HIGH) elif (xim == "ntsuab"): GPIO.output (red1, GPIO. LOW) GPIO.output (red2, GPIO. LOW) p1.start (100) p2.start (100) GPIO.output (blue1, GPIO. LOW) GPIO.output (blue2, GPIO. LOW) elif (xim == "daj"): p1.start (60) p2.start (60) GPIO.output (red1, GPIO. HIGH) GPIO.output (red2, GPIO. HIGH) GPIO.output (blue1, GPIO. LOW) GPIO.output (blue2, GPIO. LOW) elif (color == "off"): GPIO.output (red1, GPIO. LOW) GPIO.output (red2, GPIO. LOW) GPIO.output (blue1, GPIO. LOW) GPIO.output (blue2, GPIO. LOW) p1.stop () p2.stop () thaum Muaj tseeb: settime = readset () teev, feeb = teev sijhawm yog feeb == 0: yog dt (dt.now (). xyoo, dt.now (). hli, dt.now (). hnub, teev -2) <dt.now () <dt (dt.now ().year, dt.now (). hli, dt.now (). hnub, teev-1, feeb+30): coj teeb ("liab") elif dt (dt.now (). xyoo, dt.now ().month, dt.now (). hnub, teev -1, feeb+30) <dt.now () <dt (dt.now (). xyoo, dt.now (). hli, dt.now (). hnub, teev, feeb): coj teeb ("daj") elif dt (dt.now (). xyoo, dt.now (). hli, dt.now (). hnub, teev, feeb) <dt.now () <dt (dt.now (). year, dt.now (). month, dt.now (). day, hour+1, minute): ledlight ("green") else: ledlight ("off") elif dt (dt.now (). xyoo, dt.now (). hli, dt.now (). hnub, ho ur-2) <dt.now () <dt (dt.now (). year, dt.now (). hli, dt.now (). hnub, teev, feeb -30): coj teeb ("liab") elif dt (dt.now (). year, dt.now (). hli, dt.now (). hnub, teev, feeb -30) <dt.now () <dt (dt.now (). dt.now (). hli, dt.now (). hnub, teev, feeb): ledlight ("daj") elif dt (dt.now (). xyoo, dt.now (). hli, dt.now (). hnub, teev, feeb) <dt.now () <dt (dt.now (). xyoo, dt.now (). hli, dt.now (). hnub, teev+1, feeb): coj teeb ("ntsuab") ntxiv: coj teeb ("tawm") sijhawm. tsaug zog (60)
Cov ntaub ntawv index.html yog daim ntawv yooj yim tsim hauv HTML. Nws siv cov ntsiab lus ntawm ob lub thawv ntawv thiab xa lawv mus rau cov ntaub ntawv sleepset.php rau kev tuav daim ntawv. Cov ntaub ntawv PHP yooj yim dua sau cov ntaub ntawv sleepset.txt nrog cov ntaub ntawv hloov tshiab.
Kauj Ruam 5: Muab Nws Txhua Qhov Ua Ke
Nrog cov lej ua tiav thiab txhua qhov ntu luam tawm, nws yog lub sijhawm los sib dhos. Kuv ua raws cov kauj ruam no rau muab txhua yam ua ke:
- Laum ob lub qhov me me mus rau RGB LED's hauv qab ntawm lub tshuab raj thiab tso cov LEDS hauv cov qhov no.
- Muab lub raj tso rau hauv lub qhov hauv lub taub hau unicorn thiab rub nws hla kom txog thaum nws nruj. Siv kua nplaum los sab hauv kom ruaj ntseg.
- Txuas Raspberry Pi Zero W rau sab hauv ntawm lub taub hau unicorn. (Siv Hot Glue Gun Tej zaum)
- Txuas lub taub hau unicorn rau lub hauv paus unicorn.
- Txuas lub hwj huam qaum, thiab txuas tag nrho lub rooj sib txoos rau ntawm phab ntsa.
- Plug hauv lub moos.
Txij ntawm No Mus Kuv muaj Tus Menyuam Tus Menyuam Tus Kws Qhia Kev Ua Haujlwm.
Kauj Ruam 6: Ib Xyoo Tom Qab …
Ib xyoos tom qab:
Kuv cov ntxhais tsaug zog me ntsis lawm. Peb tau siv los tsa cov menyuam yaus hauv peb chav hais tias, "Txiv, lub teeb ntsuab." thiab qhov ntawd zoo kawg. Zaj dab neeg luv luv, peb tsuas yog sawv thaum 5:30 sawv ntxov hnub Saturday thaum peb npaj nws ntxiv lawm.
Yam uas kuv npaj yuav txhim kho yav tom ntej:
- Tej zaum ntxiv qee qhov ntsuas lossis lwm yam khoom zoo li lub mic thiab hais lus.
- Tej zaum hloov cov cai los ua haujlwm nrog tus hais lus siv ua lub tswb nrov vim kuv cov menyuam yuav pib kawm ntawv sai sai no.
Pom zoo:
Yuav Ua Li Cas Thiaj Ua Tau Ib Lub Caij Nyoog Tsawg Lub Caij Nplooj Ntoos Zeeg: 7 Kauj Ruam
Yuav Ua Li Cas Thiaj Ua Tau Ib Lub Caij Nyoog Tsawg Lub Caij Nplooj Ntoos Zeeg: Kuv yog ib tug menyuam yaus uas nyiam cov khoom siv hluav taws xob raws li kev nyiam ua.Koj ua koj tus kheej lub rooj mov ci thiab tawm lus Ua raws kuv rau yam khoom txias dua. Nrhiav rau: oluwadimimu342
Txhim Kho Koj Qhov Chaw Tshaj Tawm Nrog Lub Caij Nyoog Lub Caij Nyoog rau Kerbal Space Program: 6 Kauj Ruam
Txhim Kho Koj Qhov Chaw Tshaj Tawm Nrog Lub Caij Nyoog Lub Caij Nyoog rau Kerbal Space Program: Kuv tsis ntev los no tau khaws qhov demo version ntawm Kerbal Space Program. Kerbal Space Program yog qhov kev ua si sim uas tso cai rau koj tsim thiab tso foob pob hluav taws thiab coj lawv mus rau lub hli thiab ntiaj chaw nyob deb. Kuv tseem tab tom sim ua kom tiav hauv lub hli (o
Muaj Lub Caij Nyoog Qoob Qaum Nrog Cov Hws Huv Huv thiab ARDUINO: 4 Cov Kauj Ruam (nrog Duab)
Muaj Bumper Crop Nrog Cov Hws Huv Huv thiab ARDUINO: Kuv yuav tsum raug quav rau Cov Lus Qhia hauv kev ua haujlwm thiab ua kuv cov haujlwm hauv tsev kom sib qhia kuv qhov kev paub tsis muaj nyiaj rau Qhia Ntawv qhia lwm tus qhia. Kuv yog tus txiav txim tam sim no, sifting los ntawm ntau Cov Lus Qhia thiab ib txwm muaj nrhiav qee Cov Lus Qhia
Lub Teeb Pom Paj Ntoo Lub Caij Nplooj Ntoos Hlav Rau Lub Caij Ntuj Sov Music Festivals, Kab tshoob Kev Kos, Tshwj Xeeb Lub Sijhawm: 8 Kauj Ruam (nrog Duab)
Lub Teeb Pom Paj Ntoo Lub Caij Nplooj Ntoos Hlav rau Lub Caij Ntuj Sov Music Festivals, Kab tshoob Kev Ua Haujlwm, Tshwj Xeeb Sijhawm: Teeb hmo ntuj nrog paj paj zoo nkauj paj taub hau zoo nkauj! Zoo meej rau txhua kab tshoob kev kos, kev ua yeeb yaj kiab lom zem, proms, khaub ncaws thiab sijhawm tshwj xeeb! Cov khoom siv nrog txhua yam koj xav tau los ua koj tus kheej lub teeb taub hau tam sim no muaj nyob hauv Wearables Rhiav sto
Kev Cai Caij Nyoog Nrog Duab Tes: 5 Kauj Ruam (nrog Duab)
Custom Clock With Photo Hands: Qee tus neeg yog tus saib lub moos. Tam sim no txhua tus tuaj yeem yog lub moos.Lwm cov phiaj xwm kho lub ntsej muag ntawm lub moos. Qhov no yog kho lub tes ntawm lub moos Nws zoo li kim, tab sis tsawg dua $ 5 daus las, thiab kwv yees li 30 feeb hauv ib teev. Zoo meej rau Chr