Cov txheej txheem:

Tus kws qhia dev pom: 9 Kauj Ruam
Tus kws qhia dev pom: 9 Kauj Ruam

Video: Tus kws qhia dev pom: 9 Kauj Ruam

Video: Tus kws qhia dev pom: 9 Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Kaum ib hlis
Anonim
Tus Kws Qhia Tus dev
Tus Kws Qhia Tus dev

Nco tseg! Reactive Blocks tsis muaj ntxiv lawm yog li koj tsis tuaj yeem ua tiav Cov Lus Qhia no

Nrog lub ntsuas siab, coj thiab hais lus koj tuaj yeem tig koj Pi mus rau hauv tus kws qhia dev uas pom tsis tau uas cob qhia koj tus dev kom tawm ntawm lub rooj zaum. Thaum tus dev zaum ntawm lub rooj zaum, lub teeb taws ntsais thiab tus dev tau txais cov lus txib "Tawm ntawm lub rooj zaum". Thaum tus dev tawm ntawm lub rooj zaum nws yuav hnov cov lus txib "Tus dev zoo". Daim ntawv thov no tau nthuav tawm hauv Bitreactive blog.

Kauj Ruam 1: Nruab Reactive Blocks

Nruab Reactive Blocks daim ntawv www.bitreactive.com

Kauj ruam 2: Rub lub Couch Monitor From the Libraries

Rub tawm Couch Monitor From the Libraries
Rub tawm Couch Monitor From the Libraries

Hauv Eclipse editor ntawm sab laug muaj ob qhov kev pom sib txawv: Blocks pom thiab Pob Explorer Explorer saib. Nco ntsoov tias koj nyob hauv cov block pom thiab xaiv khawm ntshuam

Xaiv lub Couch Monitoring nrog Raspberry Pi hauv qab kev qhia.

Txij ntawm no koj yuav raug nug kom sau npe. Qhov no yuav ua rau koj nkag tau sai rau cov lus qhia, cov khoos phis tawj hloov pauv thiab cov tsev qiv ntawv.

Kauj Ruam 3: Nkag Siab Qhov System

Nkag Siab Qhov System
Nkag Siab Qhov System

Lub kaw lus suav nrog 4 lub tsev siv dua tshiab. Lub thawv xiav lub teeb yog Java code. Yog tias koj nyem rau ntawm Java code nws yuav qhib rau hauv lub qhov rai tshiab. Saib yog tias koj nkag siab tias lub kaw lus ua haujlwm li cas.

Kauj Ruam 4: Tsim Txoj Cai Ua Haujlwm

Tsim Txoj Cai Ua Haujlwm
Tsim Txoj Cai Ua Haujlwm

Txoj cai nyem thiab xaiv tsim los ntawm cov ntawv qhia zaub mov. Xaiv Java SE

Kauj ruam 5: Export Raws Li Runnable JAR

Export Raws li Runnable JAR
Export Raws li Runnable JAR

Tom qab cov lej cim cov pob tshawb fawb pom yuav qhib nrog txoj haujlwm tshiab tshiab cim hauv daj. Nws yuav tsum saib qee yam zoo li no (tej zaum nrog lub npe sib txawv ntawm qhov project).

Txoj cai nyem rau ntawm qhov exe project / Export thiab xaiv CouchMonitor Luanch teeb tsa. Xaiv lub npe rau JAR uas khiav tau, piv txwv. CouchMonitor.jar

Kauj Ruam 6: Npaj Koj Raspberry Pi

Npaj Koj Raspberry Pi
Npaj Koj Raspberry Pi

Yog tias koj yog tus tshiab rau Raspberry Pi, koj yuav tsum teeb tsa nws ua ntej:

- Npaj daim npav SD (peb tau sim siv NOOBS) Ntxig daim npav SD rau hauv Raspberry Pi

- Txuas tus hais lus Txuas lub network Txuas lub sensor (cov ntaub ntawv rau GPIO0, uas yog tus lej tus lej 11)

- Txuas lub LED (rau GPIO3, uas yog tus lej tus lej 15) Pib Raspberry Pi los ntawm kev txuas lub mircro USB rau lub hwj chim.

- Tshawb nrhiav tus IP chaw nyob ntawm koj tus Raspberry Pi (yog vim li cas koj thiaj xav tau lub monitor txuas nrog nws yam tsawg kawg thawj zaug. Thaum pib, koj li Raspberry Pi yuav tshaj tawm qee yam xws li: "Kuv tus IP chaw nyob yog 10.10.15.107".)

- Peb tau sim nrog Raspbian (tus ID nkag mus tsis raug: pi, password: raspberry), uas suav nrog Java los ntawm lub neej ntawd.

Kauj Ruam 7: Khiav Daim Ntawv Thov ntawm Koj Raspberry Pi

- Nkag mus rau Raspberry Pi (rau lub hauv paus nkag mus saib Kauj Ruam 4), ncaj qha lossis nyob deb ntawm ssh.

- Txheeb xyuas yog tias cov ntaub ntawv JAR runnable (couchmonitor.jar) tau theej rau Raspberry Pi.

- Ntaus sudo java -jar couchmonitor.jar txhawm rau ua daim ntawv thov ntawm Raspberry Pi.

- Thaum daim ntawv thov ua haujlwm, LED yuav pib ntsais muag thaum lub siab ntsuas tau ua rau thiab koj tus dev yuav raug hais tawm: "Tawm ntawm lub rooj zaum!" Thaum tus dev tawm ntawm lub rooj zaum, ntsais muag yuav nres thiab tus dev yuav hais tias "Tus dev zoo!"

Kauj Ruam 8: Ncua Koj Daim Ntawv Thov

Tej zaum koj xav kom daim ntawv thov ceeb toom koj tus dev yog tias nws nyob ntawm lub rooj zaum lawm thiab tsis tawm thaum hais li ntawd. Kawm txuas ntxiv koj li kab ke hauv Reactive Blocks tutorial

Pom zoo: