Cov txheej txheem:

Xa Cov Ntaub Ntawv Los Ntawm Arduino mus rau Excel (thiab Plotting Nws): 3 Cov Kauj Ruam (nrog Duab)
Xa Cov Ntaub Ntawv Los Ntawm Arduino mus rau Excel (thiab Plotting Nws): 3 Cov Kauj Ruam (nrog Duab)

Video: Xa Cov Ntaub Ntawv Los Ntawm Arduino mus rau Excel (thiab Plotting Nws): 3 Cov Kauj Ruam (nrog Duab)

Video: Xa Cov Ntaub Ntawv Los Ntawm Arduino mus rau Excel (thiab Plotting Nws): 3 Cov Kauj Ruam (nrog Duab)
Video: Cheem niam lub hnub nyoog Kawm Muas 2024, Hlis ntuj nqeg
Anonim
Xa Cov Ntaub Ntawv Los Ntawm Arduino rau Excel (thiab Plotting Nws)
Xa Cov Ntaub Ntawv Los Ntawm Arduino rau Excel (thiab Plotting Nws)

Kuv tau tshawb nrhiav ntau ntxiv rau txoj hauv kev uas kuv tuaj yeem npaj kuv li Arduino sensor nyeem hauv lub sijhawm. Tsis yog cov phiaj xwm nkaus xwb, tab sis tseem tso saib thiab khaws cov ntaub ntawv rau kev sim ntxiv thiab kho kom raug.

Qhov kev daws teeb meem yooj yim tshaj plaws kuv tau pom yog siv excel, tab sis nrog kev sib tw.

PROGRAM uas tsis xav tau ua kom tau zoo rau phiaj cov ntaub ntawv tuaj yeem nrhiav tau ntawm no

www.instructables.com/id/Plot-Live-Arduino-Data-and-Save-It-to-Excel/

Tsis tas li yog tias koj pom cov lus qhia no nthuav, tej zaum koj yuav nyiam lwm tus uas kuv tau ua (hais txog kev ua neej nyob Arduino sensor nyeem ntawm Nokia 5110 LCD):

www.instructables.com/id/Arduinonokia-lcd-…

Kauj ruam 1: Yam Koj Yuav Tsum Tau

Rau qhov no koj yuav xav tau:

-Windows (kuaj ntawm xp)

-Arduino IDE

-Microsoft chaw ua haujlwm (xeem xyoo 2010)

-PLX-DAQ (nthuav dav rau excel)

-Arduino (kuaj ntawm UNO, tab sis txhua lub rooj tsavxwm yuav tsum ua haujlwm)

Kuv xav tias koj twb tau txais Arduino, Windows, Arduino IDE thiab Excel. Nov yog qhov txuas mus rub PLX-DAQ:

www.parallax.com/downloads/plx-daq

Koj tsuas yog yuav tsum rub tawm thiab teeb tsa nws, nws yuav tsum ua haujlwm zoo. Tom qab kev teeb tsa, nws yuav cia li tsim daim nplaub tshev npe hu ua PLX-DAQ ntawm koj lub Desktop uas koj yuav pom qhov luv npe hu ua PLX-DAQ Daim Ntawv Qhia.

Thaum koj xav siv koj li Arduino xa cov ntaub ntawv kom zoo, tsuas yog qhib qhov luv.

Kauj Ruam 2: Tshooj Arduino

Arduino Tshooj
Arduino Tshooj

Tam sim no peb tau txais txhua qhov rub tawm thiab teeb tsa, cia pib nrog ntu Arduino.

Nov yog tus qauv yooj yim uas kuv tau tsim uas yuav tso saib lub sijhawm hauv kab A thiab koj lub ntsuas ntsuas hauv kab B.

Tau kawg, qhov no tsuas yog tus qauv yooj yim, uas zoo nkauj ncaj nraim thiab koj tuaj yeem kho nws kom haum rau koj cov kev xav tau.

Kuv tau ntxiv cov lus piav qhia hauv Arduino code yog li koj (thiab kuv, tom qab tsis ua haujlwm nrog nws ib ntus) paub tias ib feem ntawm txoj cai ua dab tsi.

Ntawm no yog daim duab:

// ib txwm pib ua kab 0 thiab sau qhov khoom sau ib sab ntawm LABEL

void teeb tsa () {

Serial.begin (9600); // tus lej loj dua zoo dua

Serial.println ("CLEARDATA"); // tshem tawm cov ntaub ntawv tshuav ntawm cov phiaj xwm yav dhau los

Serial.println ("LABEL, Acolumn, Bcolumn, …"); // ib txwm sau LABEL, yog li excel paub qhov tom ntej yuav yog cov npe ntawm kab ntawv (tsis yog Acolumn koj tuaj yeem sau Sijhawm piv txwv)

Serial.println ("RESETTIMER"); // rov ua timer rau 0

}

void voj () {

Serial.print ("DATA, TIME, TIMER,"); // sau lub sijhawm hauv thawj kab A thiab lub sijhawm txij li kev ntsuas pib hauv kab B

Serial.print (Adata);

Serial.print (Bdata);

Serial.println (…); // nco ntsoov ntxiv println rau lo lus txib kawg kom nws paub nkag mus rau kab tom ntej ntawm qhov thib ob

ncua (100); // ntxiv ncua

}

Pom tseeb yog tias koj tso cov cai no, nws yuav tsis ua haujlwm ntawm nws tus kheej!

Koj yuav tsum ntxiv cov mis rau Adata, Bdata thiab…. Cov qauv no tsuas yog siv rau hauv thiaj li koj paub siv lub program. Tsuas yog ntxiv Serial.read () ua haujlwm, npe nws Adata, Bdata thiab … thiab nws yuav tsum ua haujlwm.

Kauj ruam 3: Xa cov ntaub ntawv mus rau Excel

Xa cov ntaub ntawv mus rau Excel
Xa cov ntaub ntawv mus rau Excel
Xa cov ntaub ntawv mus rau Excel
Xa cov ntaub ntawv mus rau Excel
Xa cov ntaub ntawv mus rau Excel
Xa cov ntaub ntawv mus rau Excel

Tau kawg PLX-DAQ muaj ntau txoj haujlwm, uas koj tuaj yeem tshawb xyuas ntawm koj tus kheej los ntawm kev nyeem cov lus qhia hauv rar nplaub tshev uas koj rub tawm.

Yog tias koj xav tau excel los teeb koj cov ntaub ntawv tab sis tsis tuaj yeem cuam tshuam los nyeem cov lus qhia, ntawm no yog qhov luv luv ntawm yam koj tuaj yeem ua tau:

-Ua (hloov kho) cov cai los ntawm kuv cov lus qhia

-txuas koj Arduino li koj ib txwm xav tau

-Tsis Txhob Qhib Tus Kheej Saib Hauv Arduino IDE, nws yuav tsis ua haujlwm nrog excel yog tias koj ua

-qhib qhov luv rau koj daim ntawv PLX-DAQ

-excel yuav hais "Daim ntawv thov no tab tom yuav pib ua haujlwm ActiveX …", tsuas yog nyem OK

-lub qhov rai tshiab npe Cov Ntaub Ntawv Tau Txais rau Excel yuav tshwm sim

-select tus usb chaw nres nkoj koj Arduino txuas nrog (yog tias nws tsis ua haujlwm thaum xub thawj, mus los ntawm cov npe chaw nres nkoj)

-Qhov nws hais Baud, tsuas yog xaiv tus lej koj tso rau hauv koj tus lej ntawm Serial.begin (), hauv kuv qhov xwm txheej uas yuav yog 9600

-create ib daim npliag

-xaiv cov kab ntawv twg ntawm cov ntaub ntawv koj xav tau ntawm kab ntawv rau x thiab y axis (txoj hauv kev los ua qhov no txawv me ntsis nyob ntawm koj qhov kev ua tau zoo, tab sis nws tsis nyuaj rau xam)

-click sau cov ntaub ntawv ntawm PLX-DAX thiab nws yuav tsum pib sau cov ntaub ntawv

-excel yuav npaj cov ntaub ntawv raws li nws tau xa los ntawm Arduino kom ua tau zoo hauv lub sijhawm

Nyob ntawm qhov tseeb uas koj xav kom koj daim duab ua, koj tuaj yeem hloov cov yam ntxwv ntawm kab kos. Koj tuaj yeem tshuaj xyuas ib ntu ntawm kab ntawv los ntawm kev kaw cov ntaub ntawv khaws cia, nyem rau ntawm x lossis y axis thiab teeb nws mus rau qhov me dua. (ib txwm nws tau teeb tsa tsis siv neeg)

Koj tseem tuaj yeem nyem txoj cai ntawm txoj kab nkhaus uas txuas cov ntsiab lus ntawm koj daim duab thiab xaiv cov xim thiab tuab ntawm txoj kab nkhaus.

Nov yog nws rau cov hauv paus. Kuv vam tias kuv tau pab qee tus ntawm koj los ntawm kev sau qhov no. Kuv paub nws coj kuv qee lub sijhawm los nrhiav qhov no thiab kom nws ua haujlwm.

PS Yog tias koj nyiam cov lus qhia no, tej zaum koj yuav nyiam lwm qhov kuv tau ua:

Pom zoo: