how can i store the value of analog output in some other variable ?
Hi @ravi_verma,
In the graph section, you can not store the sensor value in the variable.
But you can write custom functions to fetch the data from the cloud.
async function custom_digital_read(pin) {
return new Promise(function(resolve, reject) {
var request = new XMLHttpRequest();
request.open('GET', base_url + api_key + "/digitalRead?pin=" + pin + "&deviceName=" + d_name, true);
request.onreadystatechange = function() {
if (this.readyState === 4) {
if (this.status === 200) {
resolve({
status: this.status,
body: JSON.parse(this.responseText)
});
} else {
reject({
status: this.status,
body: this.responseText
});
}
}
};
request.send();
});
}
and you can use it as
var res = await custom_digital_read(0);
var value = res.body.value;
Do let me know in case you need any other information.