1
Hello, I need to take consecutive readings of some sensors in Ionic 3.x but I can’t let it completely block the application. tried to do so:
async disparaLeituras(path_id) {
while (true) {
console.log('laço');
try {
var gyscope_data = await this.deviceMotion.getCurrentAcceleration();
console.log(gyscope_data)
} catch (e) {
console.log(e); // 30
}
}
}
however this caused the application to lock completely, beyond the acceleration sensor I check the gyroscope and the gps too, they all return Promisses, someone knows the correct way to proceed?
The easiest way is to use as a default template instead of using
await
, but maybe this does not help your use case. What you will do with this data after?– Leonardo Lima
I send to a dps api, if I take out the Wait I will diparar several Promisses and will end up crashing tbm
– Matheus Lima
if recursion is a solution, dps q a promisse performs a reading it fires the next
– Matheus Lima