Cov txheej txheem:

Tus Mappifier - Kav + Kev Ceeb Toom: 9 Kauj Ruam
Tus Mappifier - Kav + Kev Ceeb Toom: 9 Kauj Ruam

Video: Tus Mappifier - Kav + Kev Ceeb Toom: 9 Kauj Ruam

Video: Tus Mappifier - Kav + Kev Ceeb Toom: 9 Kauj Ruam
Video: Hwm Pheej Thoj - Rov Mus Txog Vib Nais 2024, Hlis ntuj nqeg
Anonim
Tus Mappifier - Kav + Kev Ceeb Toom
Tus Mappifier - Kav + Kev Ceeb Toom

Kev tsav tsheb hmo ntuj lom zem heev. Tab sis feem ntau, nws dhau los ua npau suav phem, nyob rau hauv daim ntawv ntawm cov tsiaj hla txoj kev (tshwj xeeb tshaj yog cov miv thiab dev tsis zoo, uas tos koj kom tsav tsheb ze lawv kom lawv hla tau !!). Yog li kuv xav ua qee yam uas ceeb toom koj thaum koj nyob ze rau cov chaw tsis yooj yim no, yog li koj tuaj yeem tsav tsheb kom zoo dua.

Cov kab ke muaj ob ntu: Kev Sau Cov Ntaub Ntawv & Cov Ntaub Ntawv Rov Los. Thawj ntu yuav siv cov ntaub ntawv chaw nyob, uas yog qhov chaw uas muaj qhov yuav tshwm sim ntau dua ntawm kev hla tsiaj. Cov ntaub ntawv no yuav tsum tau muab ntxiv rau tus kheej thiab hloov kho tshiab ntawm daim duab qhia chaw. Qhov tom kawg siv peb qhov chaw tam sim no thiab tom qab ntawd sib piv nws nrog cov ntaub ntawv khaws tseg thiab cov ntawv ceeb toom tsim nyog lossis ceeb toom tau muab.

Khoom siv

Kho vajtse Siv

ESP8266 WiFi kev txhim kho pawg thawj coj saib

Ublox NEO-6M GPS Module

LEDs

Momentary Push Button

Siv Software

Arduino IDE Cov

Ib qho JavaScript Editor

Firebase (rau khaws cov ntaub ntawv thiab khaws cia)

Kauj Ruam 1: Chav Kho Vajtse

Kev kho vajtse yuav tsum tau ua haujlwm ob txoj hauv kev (hom): 1) Khaws qhov chaw mus rau Database: Qhov no yog ib feem loj hauv cov txheej txheem sau cov ntaub ntawv; qhov chaw khaws los ntawm GPS module raug xa mus rau lub hauv paus firebase los ntawm ESP8266 WiFi kev txhim kho pawg thawj coj saib.

2) Muab cov ntawv ceeb toom thaum taug kev: Thaum lub sijhawm qhia, qhov chaw tam sim no tau rov qab los thiab xa mus rau lub database. Thaum txhua qhov hloov tshiab ntawm qhov chaw, qhov deb ntawm qhov chaw tam sim no thiab cov chaw (uas tau khaws cia thaum cov txheej txheem sau cov ntaub ntawv) tau suav thiab tau rov qab los ntawm ESP8266 tus qauv uas tom qab ntawv ceeb toom rau tus neeg siv raws li ze li cas cov neeg siv los ntawm cov chaw khaws cia.

Kuv ntxiv peb LEDs los ceeb toom qhov kev hloov pauv hauv kev ua haujlwm, nrog rau kev hloov kho kom ua tiav rau cov ntaub ntawv khaws tseg thiab lub teeb ceeb toom kom ceeb toom kev kaw ntawm cov neeg siv mus rau qhov chaw khaws cia.

Lub laub khawm tau siv los khaws qhov chaw nyob hauv ib nias (hauv khw/hom khaws cov ntaub ntawv) thiab tseem hloov pauv ntawm cov qauv no.

Hwj chim

Thaum pib, lub roj teeb 3.7V 300mAh Lipo tau siv, tab sis nws ua rau muaj teeb meem. Qhov teeb meem tseem ceeb yog ESP8266 rov pib dua (tej zaum yuav yog vim muaj qhov tshwm sim tam sim no). Kuj lub roj teeb tsis kav ntev. Thaum kawg lub powerbank tuaj rau kuv cawm.

Kauj ruam 2: Circuit Court

Circuit Court
Circuit Court

Kauj Ruam 3: Txog Firebase

Txog Firebase
Txog Firebase
Txog Firebase
Txog Firebase
Txog Firebase
Txog Firebase
Txog Firebase
Txog Firebase

Firebase yog lub xov tooj ntawm tes thiab lub vev xaib txhim kho kev thov, uas yog los ntawm Google. Nws muaj ntau yam ntxwv, tab sis ntawm no kuv tsuas yog siv ob qho ntawm lawv, Lub Sij Hawm Sijhawm Sijhawm thiab Huab Cua Ua Haujlwm.

Txhawm rau pib ntawm Firebase, 1. Ua ntej mus rau lub vev xaib firebase.

2. Tam sim no txav mus rau lub console thiab nyem tsim qhov haujlwm tshiab.

3. Koj yuav tsum muab lub npe phiaj xwm nrog rau lwm cov ntsiab lus los tsim ib qhov haujlwm.

4. Tom qab txoj haujlwm raug tsim nyem rau ntawm qhov xaiv database los ntawm sab pane los tsim cov ntaub ntawv tshiab.

5. Ua tib yam rau kev ua haujlwm.

Cov no yog cov txheej txheem dav dav rau kev tsim ib qhov haujlwm, firebase tau sau tseg zoo thiab muaj ntau qhov youtube video series rau cov pib, ua siab zoo nkag mus kom nkag siab ntau ntxiv.

Kauj Ruam 4: Lub Sijhawm Ruaj Ntseg

Realtime Database
Realtime Database
Realtime Database
Realtime Database

Tom qab koj tsim lub database, cov kauj ruam tom ntej yog saib yuav ua li cas cov ntaub ntawv hauv database tau khaws cia thiab tuaj yeem nkag mus tau. Rau kev sau lossis nyeem ntawv rau/los ntawm database, koj yuav tsum teeb tsa cov cai hauv paus. Rau lub hom phiaj kev txhim kho, peb tuaj yeem siv txoj cai qhib kom txhua tus neeg nrog cov ntaub ntawv siv tau tuaj yeem nyeem/sau tab sis ceev faj thaum teeb tsa cov cai. Qhov database khaws cov ntaub ntawv hauv JSON hom ntawv thiab tau sib txuas rau txhua lub cuab yeej uas txuas nrog database. Koj tuaj yeem ntxiv cov menyuam yaus siv lub cim '+' tab sis cov nodes kuj tseem tuaj yeem tsim tawm los ntawm kev ua haujlwm. Txhua cov ntaub ntawv uas peb tso rau hauv lub database hauv hom 'khw' (khaws cia qhov chaw khaws cia) tau khaws cia ntawm no raws li cov node sib cais thaum cov ntaub ntawv hauv 'ceeb toom' hom (rov qab khaws cov ntaub ntawv thaum kev qhia) tau hloov kho tshiab txhua lub sijhawm (kos duab).

Kauj Ruam 5: Teeb Ua Haujlwm Firebase

Teem Kev Ua Haujlwm Firebase
Teem Kev Ua Haujlwm Firebase
Teem Kev Ua Haujlwm Firebase
Teem Kev Ua Haujlwm Firebase
Teem Kev Ua Haujlwm Firebase
Teem Kev Ua Haujlwm Firebase

Peb xav tau qee yam los xam qhov ze ntawm qhov chaw tam sim no mus rau qhov chaw khaws cia, thiab keeb kwm keeb kwm yav dhau los ua rau lub luag haujlwm yuav ua peb txoj haujlwm. Cov haujlwm tau sau hauv javascript thiab xav tau xa mus rau lub firebase.

Koj yuav tsum muaj node.js teeb tsa hauv koj lub computer.

1) Tam sim no rub tawm cov kab hais kom ua kab sib txuas siv cov lus txib "npm install -g firebase -tools" ntawm koj cov lus txib tam sim

2) Tam sim no koj yuav tsum nkag mus rau firebase siv qhov hais kom ua "firebase ID nkag mus" (Koj yuav tsum muab koj tus lej nkag mus gmail yog tias koj tseem tsis tau nkag rau hauv)

3) Tom qab qhov no mus rau koj cov npe phau ntawv thiab pib ua haujlwm nrog cov lus txib "firebase init". Koj yuav tsum xaiv qhov 'kev ua haujlwm' xaiv rau kev pib ua haujlwm firebase rau koj txoj haujlwm.

4) Tam sim no koj yuav tsum mus rau 'cov haujlwm' nplaub tshev hauv koj phau ntawv teev npe qhov project thiab nrhiav cov ntawv 'index.js'.

5) Kho cov ntawv nrog cov ntawv sau thiab kho cov ntawv/hloov cov ntawv nrog mappifier_function.txt. (Qhov no yuav ua haujlwm zoo rau peb)

6) Thaum kawg tso koj txoj haujlwm siv "firebase deploy" ntawm qhov hais kom sai.

Koj tuaj yeem tshawb xyuas seb qhov haujlwm tau muab tso rau hauv qab cov ntawv qhia ua haujlwm ntawm koj lub firebase console

Kauj ruam 6: Code

Code
Code
Code
Code
Code
Code

Rau ESP8266:

Pawg thawj coj txuas rau WiFi thiab Firebase siv cov ntaub ntawv pov thawj thiab tos kom nias lub pob nyem. Raws li lub sijhawm ntawm lub pob nyem, hom sib txawv tau pib. Hauv hom kev khaws cov ntaub ntawv (cia peb hu hom "khw" no), txhua lub pob nyem yuav ua rau txoj haujlwm tam sim no raug xa mus rau lub chaw khaws ntaub ntawv thaum nyob hauv hom khaws cov ntaub ntawv ("hom kev ceeb toom"), qhov chaw tam sim no raug xa mus rau lub database thiab nrug yog muab los ntawm cov ntaub ntawv cia. Kuv ntxiv LEDs rau cov lus ceeb toom (ze rau qhov cim chaw) thiab ceeb toom (zoo li GPS kho, Txuas WiFi, ua tiav kev sau cov ntaub ntawv, hloov pauv, thiab lwm yam).

Rau Kev Ua Haujlwm Firebase:

Lub luag haujlwm no txheeb xyuas qhov sau rau 'qhov chaw tam sim no' ntawm lub hauv paus thiab xam qhov deb ntawm cov chaw ntawm cov chaw khaws ntaub ntawv thiab qhov chaw tam sim no thiab tom qab ntawd pom qhov deb me tshaj uas tom qab ntawv sau mus rau 'nrug' node ntawm database.

Nco ntsoov ntxiv koj li ntawv pov thawj wifi thiab firebase daim ntawv lees paub ua ntej koj rub koj lub program. (Thov saib cov duab). Tsis tas li, yog tias koj yog tus tshiab rau ESP8266 thiab sau lawv ntawm Arduino IDE, xa cov no.

Kauj Ruam 7: Yeem Kauj Ruam (Ua Lub Tsev Kaw)

Yeem Kauj Ruam (Ua Lub Tsev Nkag Mus)
Yeem Kauj Ruam (Ua Lub Tsev Nkag Mus)
Yeem Kauj Ruam (Ua Lub Tsev Nkag Mus)
Yeem Kauj Ruam (Ua Lub Tsev Nkag Mus)
Yeem Kauj Ruam (Ua Lub Tsev Nkag Mus)
Yeem Kauj Ruam (Ua Lub Tsev Nkag Mus)
Yeem Kauj Ruam (Ua Lub Tsev Nkag Mus)
Yeem Kauj Ruam (Ua Lub Tsev Nkag Mus)

Txhawm rau ua kom cov cuab yeej khoos phis tawj me me kom nws tuaj yeem ntsia tau, Kuv tau ua lub thawv me me kom haum lawv sab hauv. Ob peb lub qhov tau ua los txhawm rau txuas cov LEDs thiab txuas rau USB cable. Tab sis daim ntawv kawg yog dhau qhov kuv xav tau !! Nws haum hauv kuv xib teg zoo kawg nkaus, thiab nws yooj yim heev rau ntawm lub voj voog thiab ntawm lub kauj tsheb.

Kauj Ruam 8: Hauv Kev Ua …

Nov yog cov vis dis aus me me qhia txog ob hom (khw thiab ceeb toom) nrog ceeb toom thiab ceeb toom LEDs.

Kauj Ruam 9: Tsiv Mus Ntxiv…

Tsiv Mus Ntxiv…
Tsiv Mus Ntxiv…

Cov kab ke no tuaj yeem siv rau ntau lub hom phiaj, piv txwv li, xav txog qhov xwm txheej tam sim no, yog tias koj tuaj yeem tau txais qhov chaw kis tus kab mob thiab khaws nws hauv cov ntaub ntawv khaws tseg, cov lus ceeb toom yuav muab los ntawm cov kab ke no thaum koj nyob ze rau cov chaw ntawd. Tab sis kuv xav tiag tiag kom tau txais cov tsiaj hla cov ntaub ntawv los ntawm thoob plaws lub ntiaj teb kom ua rau cov neeg tsav tsheb ceev faj thiab txuag ntau tus tsiaj los ntawm kev raug xwm txheej. Kuv tau ua lub vev xaib yooj yim (tab sis tseem tsis tau tuav) uas muaj txhua cov ntaub ntawv uas kuv tau sau. Cov no yog cov ntaub ntawv uas kuv tau sau thaum taug kev lossis caij tsheb kauj vab (thaum twg los kuv pom tus miv lossis dev nyob rau ntawm txoj kev thaum lawv muaj kev hla ntau dua) tab sis peb xav tau cov ntaub ntawv ntau ntxiv los siv qhov no.

Kuv yog qhov tshiab ua rau nplooj ntawv web (feem ntau yog javascript) thiab lwm yam khoom thiab xav kom muaj koj cov lus qhia thiab kev txawj ntse:)

Pom zoo: