From 35c092a611c3ff89a23869c2eea636362a520f93 Mon Sep 17 00:00:00 2001 From: Christian Zufferey Date: Fri, 26 Jul 2019 11:33:56 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=C3=A9=20un=20script=20Thingspeak=20pour?= =?UTF-8?q?=20afficher=20la=20corr=C3=A9lation=20des=20temp=C3=A9ratures?= =?UTF-8?q?=20solaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Temp_DS18B20/solar_zf/thingspeak.mat | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Temp_DS18B20/solar_zf/thingspeak.mat diff --git a/Temp_DS18B20/solar_zf/thingspeak.mat b/Temp_DS18B20/solar_zf/thingspeak.mat new file mode 100644 index 0000000..6aeca7a --- /dev/null +++ b/Temp_DS18B20/solar_zf/thingspeak.mat @@ -0,0 +1,46 @@ +% Template MATLAB code for visualizing correlated data using the +% SCATTER function. + +% Prior to running this MATLAB code template, assign the channel variables. +% Set 'readChannelID' to the channel ID of the channel to read from. +% Also, assign the read field IDs to the variables 'fieldID1', 'fieldID2', and 'fieldID3'. + +% TODO - Replace the [] with channel ID to read data from: +readChannelID = []]; +% TODO - Replace the [] with the Field ID to read data from: +fieldID1 = 1; +% TODO - Replace the [] with the Field ID to read data from: +fieldID2 = 2; +% TODO - Replace the [] with the Field ID to read data from: +fieldID3 = 3; + +% Channel Read API Key +% If your channel is private, then enter the read API +% Key between the '' below: +readAPIKey = ''; + + +%% Read Data %% + +nbMesures = 50 +% Read 1 data variable +% data1 = thingSpeakRead(readChannelID, 'Field', fieldID1, 'NumPoints', 3000, 'ReadKey', readAPIKey); +[data1, time1] = thingSpeakRead(readChannelID, 'Field', fieldID1, 'NumPoints', nbMesures, 'ReadKey', readAPIKey); + +% Read 2 data variable +% data2 = thingSpeakRead(readChannelID, 'Field', fieldID2, 'NumPoints', 3000, 'ReadKey', readAPIKey); +[data2, time2] = thingSpeakRead(readChannelID, 'Field', fieldID2, 'NumPoints', nbMesures, 'ReadKey', readAPIKey); + +% Read 3 data variable +% data2 = thingSpeakRead(readChannelID, 'Field', fieldID2, 'NumPoints', 3000, 'ReadKey', readAPIKey); +[data3, time3] = thingSpeakRead(readChannelID, 'Field', fieldID3, 'NumPoints', nbMesures, 'ReadKey', readAPIKey); + + +%% Visualize Data %% + +plot(time1,data1, time2,data2, time3,data3); + +legend({'Tout','Tstock','Tin'}); +% xlabel('jour'); +ylabel('Temperature C'); +title('Mesures solaires');