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

Fix issue #34

SpeedRegulation can now only be changed if motor is not moving.
parent 473514e2
No related branches found
No related tags found
No related merge requests found
......@@ -566,6 +566,10 @@ 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.']);
end
if ~isempty(motor.speedRegulation) && speedRegulation ~= motor.speedRegulation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment