Skip to content
Snippets Groups Projects
Commit 39299004 authored by Tim Stadtmann's avatar Tim Stadtmann
Browse files

Reopen issue #34 (previous fix was buggy)

parent fd4ad1f8
No related branches found
No related tags found
No related merge requests found
......@@ -599,19 +599,23 @@ classdef Motor < MaskedHandle & dynamicprops
function set.speedRegulation(motor, speedRegulation)
if ~isBool(speedRegulation)
error('Motor::set.speedRegulation: Given parameter is not a bool.');
elseif motor.connectedToBrick && motor.physicalMotorConnected && ...
motor.currentSpeed ~= 0
error(['Motor::set.speedRegulation: Cannot change speed regulation while ', ...
'is motor is moving.']);
% elseif motor.connectedToBrick && motor.physicalMotorConnected
% pause(0.5);
% if motor.currentSpeed ~= 0
% error(['Motor::set.speedRegulation: Cannot change speed regulation while ', ...
% 'is motor is moving.']);
% end
end
if ~isempty(motor.speedRegulation) && speedRegulation ~= motor.speedRegulation
speedRegulation = str2bool(speedRegulation);
if ~isempty(motor.speedRegulation) && (speedRegulation ~= motor.speedRegulation)
if motor.sendPowerOnSet
motor.sendOnStart = bitset(motor.sendOnStart, SendOnStart.Power, 1);
end
end
motor.speedRegulation = str2bool(speedRegulation);
motor.speedRegulation = speedRegulation;
end
function set.smoothStart(motor, steps)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment