Cov txheej txheem:

Yuav Ua Li Cas Code "Tus Hiker Phau Ntawv Sau": 5 Kauj Ruam (nrog Duab)
Yuav Ua Li Cas Code "Tus Hiker Phau Ntawv Sau": 5 Kauj Ruam (nrog Duab)

Video: Yuav Ua Li Cas Code "Tus Hiker Phau Ntawv Sau": 5 Kauj Ruam (nrog Duab)

Video: Yuav Ua Li Cas Code
Video: 10 самых АТМОСФЕРНЫХ мест Дагестана. БОЛЬШОЙ ВЫПУСК #Дагестан #ПутешествиеПоДагестану 2024, Kaum ib hlis
Anonim
Yuav Ua Li Cas Code
Yuav Ua Li Cas Code
Yuav Ua Li Cas Code
Yuav Ua Li Cas Code

Tib neeg zoo li nostalgic txog yam haujlwm uas tseem ceeb rau lawv, xws li taug kev.

Tab sis koj yuav ua li cas nco txog kev taug kev?

Cov duab yog qhov kev xaiv, yog. Cov cuab yeej no yuav tso cai rau lwm txoj hauv kev los ua cov ntaub ntawv khaws tseg los ntawm kev mus. Tus neeg yuav muaj daim phiaj phiaj xwm lub sijhawm taug kev piv rau qhov siab uas lawv tau nce. Ib qho ntxiv, nws yuav qhia rau lawv qhov siab kawg, min, thiab qhov nruab nrab qhov siab lawv tau nthuav tawm thoob plaws qhov ntev ntawm kev taug kev.

Qhov no siv Internet ntawm Yam Khoom Siab thiab Siab ntsuas los saib xyuas thiab sau cov ntaub ntawv hais txog kev taug kev. MATLAB yog tom qab ntawd siv los tshuaj xyuas cov ntaub ntawv txhawm rau tso tawm qhov tseem ceeb nyeem siab thiab teeb duab ntawm lub sijhawm vs.

Kauj Ruam 1: Cov Khoom thiab Cov Khoom

Cov Khoom thiab Cov Khoom
Cov Khoom thiab Cov Khoom

Sparkfun ESP8266

Tau tshaj qhov siab/siab sensor

Hlau

USB rau micro-USB cable

ThingSpeak tus account

Arduino txog software

MATLAB software thiab ThingSpeak lub thawv cuab yeej

Kauj ruam 2: Teeb Software

Tsim ib tus account

Tsim "Channel Tshiab"

Label Field 1 raws li Qhov Siab Tshaj thiab Field 2 raws li Kev Nyuaj Siab

Txuag channel

Mus rau "Sib Koom" thiab xaiv "Qhia cov channel saib nrog txhua tus"

Muab tshuaj txhuam tus lej los ntawm [https://ef.engr.utk.edu/ef230-2017-08/projects/ard…] rau hauv Arduino

Hloov WiFi network "ssid" thiab tus password

Hloov "streamID" thiab "privateKey" kom phim API Keys ntawm ThingSpeak

Kauj Ruam 3: Teeb Kho Vajtse

Teeb Kho Vajtse
Teeb Kho Vajtse

Hlau kho vajtse raws li daim duab saum toj no

Txuas USB rau lub khoos phis tawj thiab ESP8266

Kauj ruam 4: Txuas rau Koj Lub Ntaus Ntawv

Nrhiav thiab tig qhov me me, hloov dub ntawm ESP8266 kom qhib

Nyem rau sab xub ntiag ntawm lub kaum sab saud sab saud ntawm Arduino program txhawm rau upload cov lej (qhov no yuav siv ob peb feeb)

Tam sim no lub ntsuas nyeem ntawv yuav tsum tau nthuav tawm cov ntaub ntawv mus rau ThingSpeak lub vev xaib, uas yog sawv cev ntawm cov duab

Kauj Ruam 5: MATLAB Coding

Luam cov cai hauv qab no rau kev ua haujlwm "microcontroller_project" rau hauv MATLAB

Hloov cov ntawv sau kom haum rau qhov tshwj xeeb ThingSpeak channel

(Qhov "90" hauv qhov loj yog hais txog feeb cov nuj nqis ntawm cov ntaub ntawv tau coj los rau hauv tus lej los ntawm cov channel. Hloov qhov no los ntawm tus kheej raws li ntev npaum li cas cov channel tau ua haujlwm.)

Hu rau lub luag haujlwm los ntawm kev ntaus "microcontroller_project" rau hauv Command Window

Txoj Cai:

function [graph Pressures_Pa] = microcontroller_project () data = thingSpeakRead (364102, 'Fields', [1, 2], 'NumMinutes', 90, 'OutputFormat', 'rooj');

readChannelID = 364102;

readAPIKey = 'U9AJ9S68KVNYQKQV';

altitudefieldID = 1;

pressurefieldID = 2; np.

writeChannelID = 364102;

writeAPIKey = '6H8W3UNH6HMT1TCZ';

rau kuv = 1: max (loj (cov ntaub ntawv))

timestamp = cov ntaub ntawv (i, 1);

time_cell_array = table2cell (timestamp);

time_string_array = datestr (time_cell_array {1, 1});

teev = str2num (time_string_array (13:14));

feeb = str2num (time_string_array (16:17));

thib ob = str2num (time_string_array (19:20));

sij hawm (kuv) = 3600.*teev+60.*feeb+thib ob;

kawg

alt = cov ntaub ntawv (:, 2);

alt2 = table2cell (alt);

qhov siab = transpose (cell2mat (alt2)));

p = cov ntaub ntawv (:, 3);

siab = cell2mat (table2cell (p));

lub ntsiab lus (sijhawm, qhov siab)

title ('Hiking Trail Data: Time vs. Altitude')

xlabel ('Sijhawm (sec)'))

ylabel ('Qhov siab (ft)')

str = hnub tim; lus dab neeg (str)

Pressures_Pa.max = max (siab)

Pressures_Pa.min = min (siab)

Pressures_Pa.avg = nruab nrab (siab)

kawg

Pom zoo: