8:37 am

June 21, 2016

Hey,
Im trying to get around the 15 sec update limit by having 3 channels that update depending on a few counters on the arduino.
I was hoping the next part would be easy, but it isn't.
The data I am sending to each channel is very basic. Its a door bell counter, so its either 0 or 1.
If the bell is pressed a few times within 15 seconds, then it will send the three 1's to different channels. The rest of the presses are disregarded.
I would like to show the combined presses with a 30sec timescale on another channel as a vertical line graph.
Can anyone help?
This is what I have so far:
readChannelID1 = XXXXXX; readChannelID2 = XXXXXX; readChannelID3 = XXXXXX; readAPIKey1 = 'XXXXXXXXXXXXXXXXX'; readAPIKey2 = 'XXXXXXXXXXXXXXXXX'; readAPIKey3 = 'XXXXXXXXXXXXXXXXX'; chan1 = thingSpeakRead(readChannelID1, 'Fields', 1, 'ReadKey', readAPIKey1, 'NumDays',2); chan2 = thingSpeakRead(readChannelID2, 'Fields', 1, 'ReadKey', readAPIKey2, 'NumDays',2); chan3 = thingSpeakRead(readChannelID3, 'Fields', 1, 'ReadKey', readAPIKey3, 'NumDays',2); thingSpeakPlot(chan1, chan2, chan3);
8:39 pm


Top
January 30, 2014

Suspect you need to read the timestamps as well as the data from the 3 channels . I dont know enough Matlab to show exactly how to do this maybe this will work, maybe not
[data1,time1] = thingSpeakRead(..)
[data2,time2] = thingSpeakRead(..)
[data3,time3] = thingSpeakRead(..) plot(time1,data1,time2,data2,time3,data3)
(Based off https://au.mathworks.com/help/matlab/ref/plot.html)
3:12 am

June 21, 2016

Hey rw950431,
This is creating the error
Error using horzcat
Dimensions of matrices being concatenated are not consistent.
Will keep searching Google.
Cheers
9:52 pm


Top
January 30, 2014

Guessing that its complaining because the arrays have different numbers of data points.. Does it work if you only plot one series at a time?
plot(time1,data1)
You may end having to figure out how to merge the 3 datasets together before plotting- please show me how to do it when you figure it out..
Most Users Ever Online: 166
Currently Online:
28 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
rw950431: 272
Vinod: 240
piajola: 95
turgo: 70
vespapierre: 63
Adarsh_Murthy: 62
Member Stats:
Guest Posters: 1
Members: 8665
Moderators: 1
Admins: 2
Forum Stats:
Groups: 3
Forums: 14
Topics: 1600
Posts: 5760
Newest Members:
kusmumichael, petersmith99, Rambant, blakeharriss09, optisol, Niyonzima FilsModerators: cstapels: 460
Administrators: Hans: 405, lee: 457