Cov txheej txheem:

Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua: 13 Kauj Ruam (nrog Duab)
Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua: 13 Kauj Ruam (nrog Duab)

Video: Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua: 13 Kauj Ruam (nrog Duab)

Video: Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua: 13 Kauj Ruam (nrog Duab)
Video: Sib Hawm Dhau (Time Passed) Music Video by: Deeda/Dib Xwb 2024, Kaum ib hlis
Anonim
Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua Haujlwm
Kub thiab Vaum Zaub thiab Sau Cov Ntaub Ntawv Nrog Arduino thiab Ua Haujlwm

Intro: Nov yog Txoj Haujlwm uas siv Arduino board, Sensor (DHT11), lub khoos phis tawj Windows thiab Kev Ua (rub tawm dawb) program los tso saib Kub, Cov ntaub ntawv vaum hauv digital thiab kab duab kab, tso tawm lub sijhawm thiab hnub tim thiab suav timer thaum lub sijhawm ua haujlwm thiab sau tag nrho cov ntaub ntawv mus rau hauv.csv hom ntawv thaum qhov haujlwm raug kaw.

Kev tshoov siab:

Ua ntej Kuv YUAV TSUM hais tias kuv yog tus pib tag nrho thiab kuv tau kawm paub ntau yam los ntawm txoj haujlwm no. Yog li kuv tab tom sim sau Cov Lus Qhia no kom nyeem thiab nkag siab los ntawm tus pib tag nrho.

Kuv tau pom ntau yam haujlwm Arduino txhawm rau ntsuas kub thiab av noo tab sis kuv xav tau ib txoj haujlwm uas:

1) Ntsuas kub thiab av noo

2) Tso tawm cov ntaub ntawv hauv ob daim duab (Kuv xaiv kab duab kab) thiab daim ntawv digital

3) Muaj lub sijhawm ua haujlwm

4) Muaj suav nrog "Sijhawm Sijhawm" lub sijhawm

5) Khaws cov ntaub ntawv no rau hauv.csv (excel) cov ntaub ntawv.

Kuv tau txais kev tshoov siab los ntawm cov phiaj xwm tsim los ntawm Sowmith Mandadi, R-B thiab aaakash3, tab sis tsis muaj ib qho ntawm no yog qhov kuv xav tau. Yog li kuv kawm sau qee cov lej yooj yim thiab ua qhov kuv xav tau.

Kauj Ruam 1: Yam Koj Yuav Tsum Tau:

Yam Koj Yuav Tsum Tau
Yam Koj Yuav Tsum Tau
Yam Koj Yuav Tsum Tau
Yam Koj Yuav Tsum Tau

Cov Khoom thiab Cov Khoom:*Khoos phis tawj - Kuv siv lub khoos phis tawj Windows Windows 10 kev ua haujlwm

(Kuv paub tseeb tias Linux lossis Mac tuaj yeem siv tau, Kuv tsuas yog tsis muaj yog li kuv yuav tsis npog yuav siv cov kev ua haujlwm no li cas)

*Arduino Board - Kuv siv Arduino Uno Board, tab sis ib qho Arduino board nrog USB yuav ua

*USB Cable -USB A/B cable -zoo ib yam li qub "tshuab luam ntawv cable" (feem ntau tuaj nrog Arduino Board)

*DHT 11 Kub /Vaum sensor- pheej yig $ 4 txog 8

(Nco tseg: muaj 2 qhov kuv tau siv 3 tus lej tus lej, tus lej 4 tus lej yuav xav tau siv lub khob cij thiab 10K tus tiv thaiv, tus lej 3 tus muaj daim ntawv luam tawm Circuit board uas suav nrog 10K tus tiv thaiv) saib cov duab kos rau hauv cov kauj ruam tom ntej

*Cov xov hlau txuas

Dupont xov hlau (ob tus poj niam xaus) yog tias txuas rau 3 tus pin DHT11 yam tsis muaj lub khob cij

Txheem jumper M/F xov hlau (ib kawg txiv neej ib kawg poj niam) thiab M/M jumper xov hlau (ob leeg xaus txiv neej) txuas 4 tus pin DHT11 - saib cov kauj ruam 2 kom paub ntau ntxiv

*Arduino IDE - ib txoj haujlwm rau sau Arduino cov haujlwm (hu ua sketches) dawb @

www.arduino.cc/en/Main/Software

*Ua - ib txoj haujlwm los sau cov duab kos dawb @

processing.org/download/

* "DHTLib" file -a library file (qhov no yog cov ntaub ntawv nkag mus rau hauv Arduino IDE program nyob rau hauv daim nplaub tshev hu ua "Library" qhov no yuav xav tau ntxiv rau Arduino sketch ua ntej Arduino tuaj yeem nyeem cov ntaub ntawv los ntawm DHT11 -saib kauj ruam 5 rau rub cov ntawv thiab cov lus qhia

Kauj Ruam 2: Txuas Arduino rau DHT11

Txuas Arduino rau DHT11
Txuas Arduino rau DHT11
Txuas Arduino rau DHT11
Txuas Arduino rau DHT11
Txuas Arduino rau DHT11
Txuas Arduino rau DHT11
Txuas Arduino rau DHT11
Txuas Arduino rau DHT11

Ua ntej txiav txim siab qhov twg DHT11 koj muaj

Kuv siv 3 tus pin vim nws twb muaj qhov xav tau 10K resistor.

Yog tias koj muaj 4 tus pin koj yuav xav tau 10K tus tiv thaiv thiab lub khob cij

Txuas DHT11 rau Arduino Board. Txoj haujlwm no hu rau DHT 11 teeb liab tus pin kom txuas nrog Arduino tus pin #7, Pos (+) tus pin txuas nrog 5V ntawm Arduino thiab Neg (-) rau GND ntawm Arduino.

Xa mus rau Diagrams thiab Fritzing Diagrams

Kauj ruam 3: Rub tawm Arduino IDE

Rub tawm Arduino IDE
Rub tawm Arduino IDE

Rub tawm Arduino IDE thiab teeb tsa hauv computer

www.arduino.cc/en/Main/Software

Kauj ruam 4: Txuas Arduino rau Computer

Txuas Arduino rau Computer
Txuas Arduino rau Computer

Nruab Arduino IDE ua ntej nws muaj cov tsav tsheb rau Arduino USB txuas.

Txuas Arduino rau lub computer ntawm USB.

Tos rau lub khoos phis tawj kom paub txog Arduino pawg thawj coj thiab teeb tsa cov tsav tsheb.

Qhib qhov program IDE thiab tshawb xyuas qhov txuas.

Yog tias Arduino pawg thawj coj saib tsis pom nyob hauv Cov Cuab Yeej> chaw nres nkoj (lub voj voog liab), Kaw IDE thiab rov qhib dua.

* Tseem ceeb* thaum IDE qhib thiab Arduino pawg thawj coj tau txuas nrog ntawm USB. Arduino pawg thawj coj yuav tsum txuas nrog qhov chaw nres nkoj raug. Hauv Windows khoos phis tawj qhov no raug xa mus rau COM Port. Txhawm rau ua qhov no hauv IDE mus rau Cov Cuab Yeej> Chaw Nres Nkoj:> Cov chaw nres nkoj txuas. Raws li pom hauv Kab Duab qhov chaw nres nkoj txuas (lub voj voos liab) yuav tsum phim qhov chaw nres nkoj teev tseg nyob rau hauv qab txoj cai kaum ntawm IDE program (lub voj voog daj).

Kauj Ruam 5: Thauj Lub Tsev Qiv Ntawv

Thauj Lub Tsev Qiv Ntawv
Thauj Lub Tsev Qiv Ntawv
Thauj lub Tsev Qiv Ntawv
Thauj lub Tsev Qiv Ntawv
Thauj lub Tsev Qiv Ntawv
Thauj lub Tsev Qiv Ntawv
Thauj Lub Tsev Qiv Ntawv
Thauj Lub Tsev Qiv Ntawv

Thauj lub tsev qiv ntawv rau DHT11. Qhov no tau nkag siab rau kuv thaum xub thawj tab sis yog qhov yooj yim heev.

Rub tawm cov ntawv hu ua "DHTLib" thiab unzip. Luam cov unzipped “DHTLib” cov ntaub ntawv.

Kev siv ntawm lub tsev qiv ntawv no tuaj yeem pom ntawm:

playground.arduino.cc/Main/DHTLib

(Nws tau sau los ntawm Rob Tillaart raws li kev ua haujlwm los ntawm lwm tus)

Nrhiav daim nplaub tshev Arduino ntawm koj lub computer thiab qhib nws. (Nws yuav yog txhua qhov chaw koj rub tawm IDE thiab teeb tsa nws hauv computer)

Saib daim duab

Nrhiav cov ntaub ntawv hu ua "tsev qiv ntawv" thiab qhib nws ces muab tshuaj txhuam "DHTLib" nplaub tshev rau hauv "cov tsev qiv ntawv" cov ntawv. Kaw nws thiab rov pib dua IDE.

Saib daim duab

Thaum IDE tau rov qhib dua koj tuaj yeem tshawb xyuas pom lub tsev qiv ntawv DHT tau teeb tsa. Sketch> Xws li Lub Tsev Qiv Ntawv.

Saib daim duab

Nco tseg Nyem rau DHTLib hauv "suav nrog lub tsev qiv ntawv" tab yuav tso lub tsev qiv ntawv rau hauv Arduino code li "#include dht.h".

Koj tsis tas yuav ua qhov no vim nws twb muaj nyob hauv cov cai uas koj yuav rub tawm hauv cov kauj ruam tom ntej.

Kauj Ruam 6: Tau txais Arduino Code

Tau txais Arduino Code
Tau txais Arduino Code

Rub tawm Temp_Hum_Instructable.zip cov ntaub ntawv thiab unzip. Qhib Temp_Hum_Instructable.ino nrog Arduino IDE.

Hloov pauv saib cov cai hauv qab no thiab theej thiab muab tshuaj txhuam lossis ntaus ncaj qha rau hauv Arduino IDE:

#suav nrog

dht DHT; #define DHT11PIN 7 // teeb tsa tus pin 7 rau DHT11 teeb liab txuas tsis ua haujlwm teeb tsa () {Serial.begin (9600); // opens serial} void loop () {int chk = DHT.read11 (DHT11PIN); // nyeem DHT11 Serial.print (DHT.temperature, 0); // prints temp in serial.print (","); // prints comma in serial.print (DHT.humidity, 0); // prints humidity in serial.println (); // carriage return delay (2000); // tos 2 vib nas this}

Thaum koj ua tiav nws yuav tsum zoo li Daim Duab saum toj no

Kauj Ruam 7: Thauj Txoj Cai rau Arduino

Load Code rau Arduino
Load Code rau Arduino
Load Code rau Arduino
Load Code rau Arduino
Load Code rau Arduino
Load Code rau Arduino
Load Code rau Arduino
Load Code rau Arduino

Ua ntej Tseg cov duab kos hauv qhov chaw thiab nrog lub npe koj yuav nco, Piv txwv: Temp_Hum.

Tom ntej no koj yuav tsum thauj cov duab kos mus rau Arduino lub rooj tsavxwm los ntawm kev nias Txoj Cai Ncaj Ncees xub khawm (upload).

Saib daim duab

Qhov no yuav siv ob peb feeb; koj yuav pom ib qho kev kawm nce qib ntawm sab xis.

Tom qab ntawd koj yuav pom: Ua tiav xa cov lus hauv qab sab laug thiab ntawv dawb hauv qab ntawm IDE qhia koj txog kev nco

Saib daim duab

Yog tias koj tau txais tus lej yuam kev (cov ntawv txiv kab ntxwv hauv qab ntawm IDE) nws yuav tsum yog ib qho ntawm cov hauv qab no

  1. Lub tsev qiv ntawv "DHTlib" tsis tau theej kom raug
  2. Qhov chaw nres nkoj COM tsis teeb tsa kom raug
  3. Lub sensor tsis txuas nrog kom raug
  4. Tus lej tsis tau nkag mus rau hauv IDE kom raug Cov kab ntawv txiv kab ntxwv tuaj yeem txav mus los thiab nws yuav qhia qhov tsis raug. Rov qab mus thiab txheeb xyuas nws yog qhov yuam kev yooj yim.

Thaum qhov no ua tiav saib zoo ntawm koj li Arduino board. Txhua ob peb lub vib nas this me me LED nyob ib sab ntawm cov ntawv "TX" yuav ntsais muag. Nov yog Arduino xa cov ntaub ntawv rov qab mus rau lub khoos phis tawj. Txhawm rau txheeb xyuas qhov no nyem rau ntawm lub cim iav me me nyob hauv kaum sab xis ntawm IDE.

Saib daim duab

Qhov no yuav qhib lub ntsuas saib thiab tso saib cov ntsuas kub thiab av noo sib cais los ntawm tus lej. Koj yuav nco ntsoov tias cov ntaub ntawv ntsuas kub tau teev tseg hauv Celsius. Qhov ntawd zoo peb yuav hloov mus rau Fahrenheit tom qab (lossis tsis yog koj xaiv).

Saib daim duab

Tom ntej no kaw qhov ntsuas saib thiab tom qab ntawd kaw IDE. (Koj puas nco qab khaws nws, tsis yog koj?). Tam sim no saib ntawm Arduino board dua (tsis txhob txuas nws los ntawm USB uas yog qhov uas nws tau txais lub zog, thiab xa cov ntaub ntawv mus rau qhov chaw nres nkoj txuas hauv lub computer). Puas yog nws tseem ntsais muag? Yog, zoo. Thaum qhov kev zov me nyuam raug thauj mus rau Arduino nws yuav ua haujlwm ntev li nws muaj hwj chim.

Nco tseg txog tus lej: yog tias koj saib Arduino code pib nrog "void loop ();". Tom ntej no 5 kab ntawm cov cai qhia rau Arduino nyeem cov ntaub ntawv los ntawm DHT thiab luam nws mus rau lub npav npav sib cais los ntawm tus lej. Kab tom ntej “ncua (2000);” qhia rau Arduino tos 2 vib nas this (2000 milliseconds) yog li cov ntaub ntawv tau txais txhua 2 vib nas this. Tom qab ntawd nws rov qab mus rau "void loop ();" - cov lus txib uas qhia rau Arduino kom ua nws dua. nws mus rau 10 feeb (600000 milliseconds = 10 feeb). Tau txais cov ntaub ntawv txhua 2 vib nas this xaus ua cov ntaub ntawv ntau, yog li tam sim no koj paub hloov pauv ntau npaum li cas cov ntaub ntawv tau nyeem. Tsuas nco ntsoov yog koj hloov tus nqi tom qab koj yuav yuav tsum tau xa qhov program tshiab.

OK zaum rov qab thiab ua pa koj nyob ntau dua ib nrab txoj kev. Yog !!

Kauj ruam 8: Rub tawm thiab Nruab Ua

Rub tawm thiab Nruab Ua
Rub tawm thiab Nruab Ua
Rub tawm thiab Nruab Ua
Rub tawm thiab Nruab Ua

processing.org/download/

Zoo nkauj ncaj nraim rau pem hauv ntej xaiv qhov program uas sib haum rau koj lub khoos phis tawj rau windows 64bit vs. 32 ntsis. Yog tias koj tsis paub, qhib lub Tswj vaj huam sib luag ntawm koj lub khoos phis tawj (icon saib tsis yog pawg saib) thiab mus rau kab ke nws yuav raug teev nyob ntawd.

Saib daim duab

Rub tawm thiab nruab qhov program.

Thawj zaug koj qhib thiab ua haujlwm koj yuav zaum tau txais Java cov lus ruaj ntseg. Nyem "tso cai" rau cov network ntiag tug. Java yog lub computer lus siv los ntawm Kev Ua (thiab Arduino IDE). Qhov txaus siab kuv tsis tau muaj xov xwm kev nyab xeeb nrog Arduino IDE, tsuas yog ua.

Kauj Ruam 9: Ua Txoj Cai

Ua Txoj Cai
Ua Txoj Cai

OK tam sim no rau Txoj Cai Ua.

Nov yog qhov nyuaj tshaj plaws rau kuv, tab sis kuj yog lub sijhawm tshaj plaws rau kev kawm. Thaum tus lej Arduino yog 20 lossis yog li kab kab ntawv no muaj +/- 270 kab hauv cov cai tseem ceeb thiab lwm 70 + hauv cov chav kawm.

Tam sim no thawj yam uas koj yuav tsum tau nug yog "Cov chav kawm yog dab tsi?". Cov lus nug zoo. Qhov no hais txog kev tsom mus rau lub hom phiaj. Hauv ntej, muaj ntau yam khoom mus rau hauv cov cai tseem ceeb: txhais qhov loj me thiab xim ntawm cov zaub, lub moos, lub sijhawm, tus lej los qhia tus cursor qhov chaw, tus lej khaws cov ntaub ntawv rau hauv.csv cov ntaub ntawv thiab ob peb kab. uas cuam tshuam nrog cov cai uas qhia txog kab ntawv kab. Thaum Arduino IDE muaj tag nrho cov cai ntawm ib nplooj ntawv, txoj cai ua haujlwm no muaj peb tabs. Thawj yog tus lej tseem ceeb thiab ob qhov tom ntej yog cov cai uas qhia txog kab ntawv kab. (Cov cai no tau khaws cia rau hauv peb daim ntawv cais hauv Cov Txheej Txheem Txheej Txheem.) Cov tab sib cais tau hu ua "chav kawm" thiab tau hais tseg hauv kab 48 thiab 56 thiab tom qab ntawd nthuav tawm los ntawm kab 179-182 ntawm cov cai tseem ceeb. Cov neeg uas tau sau Cov txheej txheem ua haujlwm hu rau lub hom phiaj ua haujlwm no. (saib: https://processing.org/tutorials/objects/ rau kev piav qhia luv).

Yeej yog dab tsi cov chav kawm (Recta1, Recta2) hauv cov cai no ua yog tsim cov duab plaub uas txav mus thiab nqis raws li cov ntaub ntawv tau txais los ntawm DHT11 ntawm cov lej. Xav tias tus qauv ntsuas kub qub zoo dua cov mercury mus rau qhov kub dua, tab sis qhov no ua tiav nrog cov ntaub ntawv tsis yog mercury. Qhov tseeb cov chav kawm tsim plaub lub duab plaub, ob lub duab plaub zoo li qub uas sawv cev rau tom qab ntawm tus pas ntsuas kub thiab ob lub duab plaub uas hloov pauv uas teb cov ntaub ntawv thiab txav mus thiab nce. Ntxiv rau kev txav cov duab plaub, cov cai hloov xim ntawm lub duab plaub hloov pauv thiab xim ntawm cov duab digital ntawm Temp thiab Vaum raws li cov ntaub ntawv tau txais los ntawm cov lej.

Kauj ruam 10: Ua Cov Cai Cov Ntaub Ntawv

Tsuas yog ob peb lub hauv paus ntawm Kev Ua Tus Txheej Txheem:

Kuv pom zoo kom nyeem Ua: Pib Nrog Kev Ua Haujlwm los ntawm Casey Reas thiab Ben Fry tus tsim cov txheej txheem.

processing.org/books/#reasfry2

Kuv yuav tsis sim piav qhia txhua yam ntawm Kev Ua lossis sau cov cai rau kev ua. Raws li kuv tau hais ua ntej kuv yog tus pib thiab kuv xav tias muaj cov neeg zoo dua los kawm los ntawm. Txawm li cas los kuv nkag siab cov cai kuv tau sau (sim thiab yuam kev yog cov kws qhia zoo).

1. Thawj qhov yuav tsum suav nrog cov tsev qiv ntawv (ib yam li hauv Arduino) thiab tshaj tawm cov kev hloov pauv (Kab 1-25)

2. Tom ntej teeb tsa pawg thawj coj saib (Kab 27-63)

3. Kuv rov ua dua ib feem ntawm txoj cai- kuv txhais li cas yog ib feem ntawm cov cai yuav rov ua dua yog tias qhov haujlwm tau ua. Koj yuav nco Hauv Arduino "void loop ();" (Kauj Ruam 6). Hauv Kev Ua Qhov no tam sim no "tsis muaj kos ();" (Kab 65-184)

4. Tom ntej no yog tau txais cov ntaub ntawv los ntawm cov chaw nres nkoj txuas thiab muab nws rau cov lej sib txawv (int, ntab, Txoj hlua)

ib-

ntab-

Txoj hlua-

(Kab 185-245)

4. Txhua txoj hauv kev kaw qhov haujlwm thiab khaws cov ntaub ntawv (Kab 246-271)

Ok: Rub cov ntawv Temp_Hum_F_3_2 (rau Fahrenheit)

Los Temp_Hum_C_3_1 (rau Centigrade)

thiab unzip cov ntaub ntawv. Qhib nrog Ua.

Kauj Ruam 11: Font in Processing

Font hauv Kev Ua
Font hauv Kev Ua

Tseem ceeb: Kuv hu koj mloog kab 36-37

36 font = loadFont ("SourceCodePro-Bold-48.vlw"); // ntim font khaws cia hauv cov ntaub ntawv

nplaub tshev 37 textFont (font);

Lub tsev qiv ntawv font no "SourceCodePro-Bold-48.vlw" suav nrog hauv Kev Ua Cov Ntaub Ntawv rub tawm thiab tsis tas yuav hloov pauv mus ua haujlwm.

Txawm li cas los xij los hloov font mus rau lwm yam koj yuav tsum tau ntim cov ntawv tshiab rau hauv Tus Txheej Txheem Duab thiab hloov "SourceCodePro-Bold-48.vlw" nrog tus ntawv tshiab.

. Luckily Kev Ua Haujlwm tau ua thawj ntu yooj yim heev.

Ua ntej qhib qhov kos duab ces nyem:

Cuab Yeej> Tsim font

qhov no ua rau lub qhov rais qhib

Saib daim duab

Txav mus rau tus font tshiab uas koj xav tau, Nyem rau nws thiab tom qab ntawv nyem OK. Tam sim no tus ntawv tau raug thauj mus rau hauv daim duab kos.

Tom ntej no hloov qhov "SourceCodePro-Bold-48.vlw" cov ntawv nrog lub npe tseeb ntawm tus tsiaj ntawv tshiab (suav nrog.vlw hom ntawv)

Yog tias qhov no tsis ua tiav cov ntawv tshiab yuav tsis thauj mus rau hauv qhov chaws thiab tus lej yuav muab yuam kev (Ib yam li yuam kev hauv Arduino- hauv lub npov dub hauv qab ntawm qhov haujlwm).

Kauj ruam 12: Ua tiav

Tiav tiav
Tiav tiav
Tiav tiav
Tiav tiav
Tiav tiav
Tiav tiav
Tiav tiav
Tiav tiav

Txhawm rau pib Ua Haujlwm txoj haujlwm nyem rau ntawm tus xub, koj yuav tau txais kev ceeb toom Java, Nyem: Tso cai nkag mus.

Saib daim duab

OK, qhov program puas ua haujlwm? Yog tias yog, koj yuav tau txais cov zaub zoo li pom hauv daim duab.

(Tsis yog? Saib kev daws teeb meem hauv cov kauj ruam tom ntej)

Yog? Tam sim no sim tuav DHT11 hauv koj lub xib teg kaw lossis tso rau hauv qab cua sov ntawm cov tshuab ziab plaub hau. Cov lej yuav tsum hloov pauv. Yog? Zoo kawg. uas txhais tau tias txhua yam ua haujlwm tau zoo.

Txhawm rau kaw qhov haujlwm thiab khaws cov ntaub ntawv nyem rau lub npov uas hais tias "Nyem qhov no Kaw thiab Txuag Cov Ntaub Ntawv".

Tam sim no kom pom cov ntaub ntawv khaws tseg, mus rau Temp_Hum_F_3_1 lossis Temp_Hum_C_3_1 Ua cov ntawv tais ceev tseg (koj yuav tsum tuaj yeem pom qhov no ntawm koj tus kheej los ntawm tam sim no) qhib nws thiab nrhiav Cov Ntaub Ntawv. Qhib qhov no thiab koj yuav tsum pom.csv cov ntaub ntawv npe tom qab hnub thiab sijhawm koj kaw qhov program (Piv txwv 1-10-18--22-30-16.csv txhais tau tias Lub Ib Hlis 10 2018 10:30:16 PM). Qhib qhov no nrog Excel (lossis Qhib chaw ua haujlwm nthuav tawm daim ntawv sib npaug). Koj yuav tsum pom qee yam zoo li daim duab. Kab rau Hnub, Sijhawm, sijhawm ua haujlwm, huab cua thiab av noo nrog cov ntaub ntawv. Tam sim no koj tuaj yeem teeb cov ntaub ntawv nrog excel lossis txhua yam koj xav ua nrog nws. (Nco tseg: yog tias koj saib thawj cov ntaub ntawv nkag mus Temp thiab Humidity cov ntaub ntawv tsis raug, qhov no yog ib qho thiab tsuas yog yuam kev thaum qhov haujlwm pib ua ntej)

OK yees !!!!!

Koj ua nws

Yog tias koj muaj lus nug thov tshaj tawm thiab kuv yuav ua qhov zoo tshaj los teb thiab pab.

Ua tsaug rau nyob nrog qhov no thiab hmoov zoo. Kuv vam tias qhov no tsuas yog pib…..

Tom ntej no rau kuv Bluetooth thiab tej zaum Android …

Kauj ruam 13: Teeb meem

Teeb meem
Teeb meem
Teeb meem
Teeb meem

Teeb meem Arduino

Yog tias koj tau txais tus lej yuam kev (cov ntawv txiv kab ntxwv hauv qab ntawm IDE) nws yuav tsum yog ib qho ntawm cov hauv qab noLub tsev qiv ntawv "DHTlib" tsis tau luam tawm kom raug

Qhov chaw nres nkoj COM tsis teeb tsa kom raug

Lub sensor tsis txuas nrog kom raug

Txoj cai tsis raug thauj mus rau hauv IDE kom raug

Yog tias txhua tus Arduino zoo li mus OK nco ntsoov qhib Serial Monitor thiab saib yog tias cov ntaub ntawv raug nthuav tawm

Yog tias koj pom cov ntaub ntawv raug qhov no txhais tau tias sab Arduino tau ua haujlwm tag- Nco Ntsoov Kaw Tus Kheej Saib Ua Ntej ua ntej pib ua, yog Serial Monitor tau qhib Kev Ua tsis tau nyeem cov ntaub ntawv.

Ua Teeb Meem:

Cov no yuav muab tso rau hauv qab ntu ntawm Txoj Haujlwm Kev Ua Haujlwm.

Yog tias koj tau txais qhov yuam kev piav qhia "font" rov qab mus rau kauj ruam 11 thiab thauj cov font raws li tau piav qhia.

Yog tias koj tau txais qhov ua yuam kev uas zoo li: Yuam kev, xiam oob khab serialEvent () rau COM4 tsis yog- tsuas yog rov pib ua Daim duab kos los ntawm txhaj rau xub raws li hauv kauj ruam 12

Yog tias koj tau txais qhov yuam kev uas hais tias: Yuam kev qhib qhov chaw nres nkoj txuas- sim hloov kab 32-34 rau qee yam xws li qhov twg "COM4" phim qhov chaw nres nkoj COM hauv koj daim duab Arduino

myPort = newSerial (qhov no, "COM4", 9600); // Chaw nres nkoj myPort.bufferUntil ('\ n') // tos kom txog thaum muaj cov ntaub ntawv

Pom zoo: