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

Implement WIP-version of releaseBrake

parent 7ba6093f
Branches
Tags
No related merge requests found
......@@ -544,6 +544,24 @@ classdef Motor < MaskedHandle & dynamicprops
end
end
function releaseBrake(motor)
% WIP and seems to be buggy still
if ~motor.connectedToBrick
error(['Motor::releaseBrake: Motor-Object not connected to comm handle.',...
'You have to call motor.connect(commInterface) first!']);
elseif ~motor.physicalMotorConnected
error('Motor::releaseBrake: No physical motor connected to Port %s',...
port2str('Motor', motor.port));
elseif motor.isRunning
error('Motor::releaseBrake: Can''t loose brake because Motor is running');
end
motor.commInterface.outputPower(0, motor.port, 0);
motor.commInterface.outputStart(0, motor.port);
motor.commInterface.outputStop(0, motor.port, BrakeMode.Coast);
motor.sendOnStart = bitset(motor.sendOnStart, SendOnStart.Power, 1);
end
%% Setter
function set.power(motor, power)
if ~isnumeric(power)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment