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

Fix debug-layers

If debug=2, the lower-layers are now properly set to debug mode.
parent c20a1ddd
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,6 @@ classdef EV3 < handle
properties (Hidden, Access = 'private') % Hidden properties for internal use only
init = 1; % Indicates 'init-phase' (Set to 1 as long as constructor is running)
verbose = 0; % Debug mode for low level layers
end
methods % Standard methods
......@@ -114,16 +113,16 @@ classdef EV3 < handle
ev3.setProperties(varargin{:});
ev3.motorA = Motor('A', 'Debug', ev3.debug-ev3.verbose);
ev3.motorB = Motor('B', 'Debug', ev3.debug-ev3.verbose);
ev3.motorC = Motor('C', 'Debug', ev3.debug-ev3.verbose);
ev3.motorD = Motor('D', 'Debug', ev3.debug-ev3.verbose);
ev3.motorA = Motor('A', 'Debug', ev3.debug);
ev3.motorB = Motor('B', 'Debug', ev3.debug);
ev3.motorC = Motor('C', 'Debug', ev3.debug);
ev3.motorD = Motor('D', 'Debug', ev3.debug);
ev3.sensor1 = Sensor('1', 'Debug', ev3.debug-ev3.verbose);
ev3.sensor2 = Sensor('2', 'Debug', ev3.debug-ev3.verbose);
ev3.sensor3 = Sensor('3', 'Debug', ev3.debug-ev3.verbose);
ev3.sensor4 = Sensor('4', 'Debug', ev3.debug-ev3.verbose);
ev3.sensor1 = Sensor('1', 'Debug', ev3.debug);
ev3.sensor2 = Sensor('2', 'Debug', ev3.debug);
ev3.sensor3 = Sensor('3', 'Debug', ev3.debug);
ev3.sensor4 = Sensor('4', 'Debug', ev3.debug);
ev3.init = 0;
end
......@@ -180,7 +179,7 @@ classdef EV3 < handle
try
% Connect to physical brick
% -> Creating Brick-object implicitly establishes connection
ev3.brick = Brick('debug', ev3.verbose, varargin{1:end});
ev3.brick = Brick('debug', ev3.debug>=2, varargin{1:end});
ev3.isConnected = 1;
if beep
......@@ -506,8 +505,8 @@ classdef EV3 < handle
ev3.debug = debug;
end
if debug == 2
ev3.verbose = 1;
if ev3.isConnected()
ev3.brick.debug = (ev3.debug >= 2);
end
end
......@@ -515,7 +514,7 @@ classdef EV3 < handle
%setProperties Set multiple EV3 properties at once using MATLAB's inputParser.
%
% Arguments
% * 'debug', 0/1/'on'/'off'/'true'/'false'
% * 'debug', 0/1/'on'/'off'/'true'/'false'/2
% * 'batteryMode', 'Voltage'/'Percentage': Mode in which batteryValue will be read.
%
% Example
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment