diff --git a/source/EV3.m b/source/EV3.m index 5b36c75b9caf0cfcbf1b05e885c9a68587052c1f..25c04ca6a7e03093e56f585d1c4dc2ff8e042733 100644 --- a/source/EV3.m +++ b/source/EV3.m @@ -256,6 +256,11 @@ classdef EV3 < MaskedHandle % Sends a stop-command to all motor-ports. ev3.commInterface.outputStopAll(); end + + function resetAllDeviceValues(ev3) + % Resets values of all sensors on all ports (including tacho counter on motors) + ev3.handleCommand(@inputDeviceClrAll, false, 0); + end %% Sound functions function beep(ev3) diff --git a/source/Sensor.m b/source/Sensor.m index 5e6ac9fe283051a0bf4ac8d61703648213e8bb33..a7300c21c8fb501124b2407c7fdf09a30ad42f91 100644 --- a/source/Sensor.m +++ b/source/Sensor.m @@ -235,13 +235,11 @@ classdef Sensor < MaskedHandle function reset(sensor) % Resets sensor value. % - % Notes: - % * This clears ALL the sensors right now, no other Op-Code available... :( + % Notes: + % * Has not been thoroughly tested but seems to work as expected % -% warning(['Current version of reset resets ALL devices, that is, ',... -% 'all motor tacho counts and all other sensor counters!']); - sensor.handleCommand(@inputDeviceClrAll, false, 0); + sensor.handleCommand(@inputDeviceClrChanges, false, 0, sensor.port); end %% Setter