STOP WHILE CYCLE FROM MOBILE APP
Mostra commenti meno recenti
I try to develop a code to acquire data from sensors. I want to use Matlab Mobile App. My question is that is possibile to acquire Data until (while cycle) I press "STOP" button in app. I try whit this code, but it dosen't work
clear all
close all
clc
m = mobiledev;
m.AccelerationSensorEnabled = 1;
m.AngularVelocitySensorEnabled = 1;
m.Logging = true;
while m.Logging
[a,~] = accellog(m);
[ang,~] = angvellog(m);
end

2 Commenti
Geoff Hayes
il 30 Mag 2019
Lorenzo - I haven't used the mobiledev app before, but some GUIs that are designed in a similar manner with a "tight" while loop (i.e. a loop that is not interruptible) require that you add a short pause to the code. Try updating your code as
while m.Logging
[a,~] = accellog(m);
[ang,~] = angvellog(m);
pause(0.001);
end
to see if that helps.
Lorenzo Giannini
il 30 Mag 2019
Risposta accettata
Più risposte (0)
Community
Più risposte nel Distance Learning Community
Categorie
Scopri di più su Sensor Data Collection in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!