İnternetteki kodları uyarlamaya çalıştık bilgimiz olmadığından yapamadık. Yardımcı olabilir misiniz
function GetArduinoInputs()
{
nocache = "&nocache=" + Math.random() * 1000000;
if (data_val>25) {
const tmstmp = Math.floor(Date.now() / 1000);
if (tmstmp > son_gonderilen_mesaj_tarihi + 2 * 60) {
const xhr = new XMLHttpRequest();
const url = 'url/sms.php';
xhr.open('GET', url);
xhr.send();
son_gonderilen_mesaj_tarihi = tmstmp;
}
}
var request = new XMLHttpRequest();
request.onreadystatechange = function()
{
if (this.readyState == 4) {
if (this.status == 200) {
if (this.responseXML != null) {
data_val = this.responseXML.getElementsByTagName('analog')[0].childNodes[0].nodeValue;
data_val2 = this.responseXML.getElementsByTagName('analog')[1].childNodes[0].nodeValue;
}
}
}
}
request.open("GET", "ajax_inputs" + nocache, true);
request.send(null);
setTimeout('GetArduinoInputs()', 750);
}