Hi, I’m trying to print on my page two datas from a buffer, the two variables are actualised all the second.
To get the datas I use :
liveData() {
var that = this;
setInterval(function() {
BluetoothSerial.isConnected().then(()=> {
BluetoothSerial.read().then((data) => {
console.log(data);
this.tabLive = data.split('\n');
var line = this.tabLive[0].split(",");
console.log("line");
console.log(line);
this.tempLive = parseInt(line[4]);
this.turbidityLive = parseInt(line[3]);
console.log("tempLive"+this.tempLive);
console.log("turbidityLive"+this.turbidityLive);
});
});
}, 1100);
}
I call this function in the constructor, and I use :
<input [(value)]="tempLive" >
<input [(value)]="turbidityLive" >
in order to print the data in my page, but I just have undefined printed …
Do you have an idea why ?