Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ev3-toolbox-matlab
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mindstorms
ev3-toolbox-matlab
Commits
d398f5e1
Commit
d398f5e1
authored
5 years ago
by
Maximilian Schnabel
Browse files
Options
Downloads
Patches
Plain Diff
Revert "added warning to setProperties, if invalid input parameters are given"
This reverts commit
1c8f3a2e
parent
1358c13c
Branches
Branches containing commit
Tags
v1.0
2 merge requests
!7
Keep going if mountpoint exists (persistent)
,
!6
Docs NXT compatibility
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/Motor.m
+27
-33
27 additions, 33 deletions
source/Motor.m
with
27 additions
and
33 deletions
source/Motor.m
+
27
−
33
View file @
d398f5e1
...
...
@@ -347,15 +347,17 @@ classdef Motor < MaskedHandle & dynamicprops
% * This is a pretty 'heavy' function, as it tests if both motors are
% connected AND aren't running, wasting four packets, keep that in mind.
%
% Example:
% b = EV3(); % |br|
% b.connect('usb'); % |br|
% m = b.motorA; % |br|
% slave = b.motorB; % |br|
% m.power = 50; % |br|
% m.syncedStart(slave); % |br|
% % Do stuff |br|
% m.stop(); % |br|
%::
%
% Example:
% brick = EV3();
% brick.connect('usb');
% motor = brick.motorA;
% slave = brick.motorB;
% motor.power = 50;
% motor.syncedStart(slave);
% % Do stuff
% motor.stop();
%
% See also MOTOR.STOP, MOTOR.SYNCEDSTOP / :meth:`stop`, :meth:`syncedStop`
...
...
@@ -713,20 +715,21 @@ classdef Motor < MaskedHandle & dynamicprops
% power (numeric in [-100,100]): *[OPTIONAL]*
% batteryMode ('Voltage'|'Percentage'): *[OPTIONAL]*
%
% Example:
% b = EV3(); % |br|
% b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
% b.motorA.setProperties('debug', 'on', 'power', 50, 'limitValue', 720, 'speedRegulation', 'on'); % |br|
% % Instead of: b.motorA.debug = 'on'; |br|
% % b.motorA.power = 50; |br|
% % b.motorA.limitValue = 720; |br|
% % b.motorA.speedRegulation = 'on'; |br|
% ::
%
% Example:
% brick = EV3();
% brick.connect('bt', 'serPort', '/dev/rfcomm0');
% brick.motorA.setProperties('debug', 'on', 'power', 50, 'limitValue', 720, 'speedRegulation', 'on');
% % Instead of: brick.motorA.debug = 'on';
% % brick.motorA.power = 50;
% % brick.motorA.limitValue = 720;
% % brick.motorA.speedRegulation = 'on';
%
p
=
inputParser
();
p
.
KeepUnmatched
=
1
;
% Set default values
if
motor
.
init
defaultDebug
=
0
;
...
...
@@ -764,17 +767,7 @@ classdef Motor < MaskedHandle & dynamicprops
% Parse...
p
.
parse
(
varargin
{:});
if
~
isempty
(
fieldnames
(
p
.
Unmatched
))
A
=
fieldnames
(
p
.
Unmatched
);
warn
=
'The following input parameters were invalid: '
;
warn
=
[
warn
A
{
1
}];
for
i
=
2
:
length
(
A
)
warn
=
[
warn
', '
A
{
i
}];
end
warning
(
warn
)
end
% Set properties
if
motor
.
init
motor
.
port
=
p
.
Results
.
port
;
...
...
@@ -1049,9 +1042,10 @@ classdef Motor < MaskedHandle & dynamicprops
end
% If motor is *busily* running, stop it. That avoids suicidal stuff like:
% b = EV3(); b.connect('usb');
% b.motorA.start();
% b.disconnect(); -> Motor still running and cannot directly be stopped anymore
% brick = EV3();
% brick.connect('usb');
% brick.motorA.start();
% brick.disconnect(); -> Motor still running and cannot directly be stopped anymore
if
motor
.
isRunning
motor
.
stop
();
end
...
...
@@ -1073,4 +1067,4 @@ classdef Motor < MaskedHandle & dynamicprops
end
end
end
end
\ No newline at end of file
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment