Quantcast
Channel: ThingSpeak IoT Community - All Forums
Viewing all articles
Browse latest Browse all 1833

cstapels on React to a change on more than one field help

$
0
0

You could use a fourth field. Put data in field 4 each time you update field 1 or field 2.  Then trigger your react on field 4 with new data and have your matlab analysis check for data in field 1 or 2 and update field 3 based on the data check in your analysis app.

You could do something similar to this

data=thingSpeakRead(YOURCHANN#,'Fields',[1,2]); %add read api key if necessary

if isnan(data(1))

data(1)=0;

end

if isnan(data(2))

data(2)=0;

end

value=data(1) & data(2);

thingSpeakWrite(YOURCHANNEL,value,'fields',3,'WriteKey','WRITEAPIKEY'));


Viewing all articles
Browse latest Browse all 1833

Trending Articles