Pause execution to allow sensor connection
Show older comments
I am attempting to write a script that will turn connector on and after displaying the IP address and password, pause to allow the user an opportunity to connect to MATLAB. So far every attempt at pausing (by either the pause command, waitfor command, or uiwait) results in the device not connecting to MATLAB. If I stop the script altogether by using Ctrl+C, the device immediately connects. Is there a way to pause to allow time for a user to connect to MATLAB before proceeding?
MATLAB R2016a on Mac OS X 10.11.4
MATLAB Mobile 5.2.1 on iOS 9.3.1
----------------------------------
clc; % clean start, phase 1
clearvars; % clean start, phase 2
connector off; % to make sure IP is displayed to user in next stage
%this house is clean
disp(sprintf('Initializing network communications...\n'));
connector on 12345; % turn on connector
m=mobiledev; % initialize sensor
h=(msgbox(sprintf('Connect to the IP address shown.\nThe password is: 12345')));
waitfor(h);
1 Comment
Geoff Hayes
on 2 Apr 2016
Joshua - please clarify what you mean by allow the user an opportunity to connect to MATLAB. What are the steps that the user is following to make the connection?
Answers (0)
Categories
Find more on App Building in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!