Skip to content
Snippets Groups Projects
Commit bf5fa80a authored by Maximilian Schnabel's avatar Maximilian Schnabel
Browse files

adjusted doc formatting

parent 823d9fa2
No related branches found
No related tags found
2 merge requests!7Keep going if mountpoint exists (persistent),!6Docs NXT compatibility
classdef Sensor < MaskedHandle classdef Sensor < MaskedHandle
% High-level class to work with sensors. Information given in this doc can be used to adjust settings of % Information given in this section can be used to configure a sensor's measurements.
% sensor objects within the EV3 class. % For example the Touch-Sensor is capable of either detecting whether it is being pushed, or count the number of pushes.
% In order to change it's mode and hence it's return values, an EV3 object has to be created and connected beforehand. Assuming the physical sensor has
% been connected to sensor port 1 of the physical brick, the mode change is done as follows:
%
% ::
%
% Example:
% //initialization:
% brick = EV3()
% brick.connect('usb')
%
% //changing mode of sensor:
% brick.sensor1.mode = DeviceMode.Touch.Bumps
%
% The available modes to a given sensor are described in the Attributes section.
% %
% The Sensor-class facilitates the communication with sensors. This mainly consists of
% reading the sensor's type and current value in a specified mode.
% %
% Notes: % Notes:
% * You don't need to create instances of this class. The EV3-class automatically creates % * You don't need to create instances of this class. The EV3-class automatically creates
...@@ -55,14 +67,7 @@ classdef Sensor < MaskedHandle ...@@ -55,14 +67,7 @@ classdef Sensor < MaskedHandle
% * DeviceMode.NXTColor.Ambient % * DeviceMode.NXTColor.Ambient
% * Output: value in range 0% to 100% brightness % * Output: value in range 0% to 100% brightness
% * DeviceMode.NXTColor.Color % * DeviceMode.NXTColor.Color
% *Output: value representing color: % * Output: value representing color: 1-black, 2-blue, 3-green, 4-yellow, 5-red, 6-white, 7-brown
% 1 - black
% 2 - blue
% 3 - green
% 4 - yellow
% 5 - red
% 6 - white
% 7 - brown
% * DeviceMode.NXTColor.Green % * DeviceMode.NXTColor.Green
% * Output: value in range 0% to 100% of green reflectivity % * Output: value in range 0% to 100% of green reflectivity
% * DeviceMode.NXTColor.Blue % * DeviceMode.NXTColor.Blue
...@@ -104,25 +109,7 @@ classdef Sensor < MaskedHandle ...@@ -104,25 +109,7 @@ classdef Sensor < MaskedHandle
% * Output: 0 to 180 degree. 45° being north, 90° east etc % * Output: 0 to 180 degree. 45° being north, 90° east etc
% * HTColor-Sensor: % * HTColor-Sensor:
% * DeviceMode.HTColor.Col *[Default]* % * DeviceMode.HTColor.Col *[Default]*
% *Output: value representing color: % * Output: value representing color: 0-black, 1-purple, 2-blue, 3-cyan, 4-green, 5-green/ yellow, 6-yellow, 7-orange, 8-red, 9-magenta, 10-pink, 11-low saturation blue, 12-low saturation green, 13-low saturation yellow, 14-low saturation orange, 15-low saturation red, 16-low saturation pink, 17-white
% 0 - black
% 1 - purple
% 2 - blue
% 3 - cyan
% 4 - green
% 5 - green/ yellow
% 6 - yellow
% 7 - orange
% 8 - red
% 9 - magenta
% 10 - pink
% 11 - low saturation blue
% 12 - low saturation green
% 13 - low saturation yellow
% 14 - low saturation orange
% 15 - low saturation red
% 16 - low saturation pink
% 17 - white
% * DeviceMode.HTColor.Red % * DeviceMode.HTColor.Red
% * Output: value in range 0 to 255 of red reflectivity % * Output: value in range 0 to 255 of red reflectivity
% * DeviceMode.HTColor.Green % * DeviceMode.HTColor.Green
...@@ -163,6 +150,8 @@ classdef Sensor < MaskedHandle ...@@ -163,6 +150,8 @@ classdef Sensor < MaskedHandle
% * DeviceType.Unknown % * DeviceType.Unknown
% * DeviceType.None % * DeviceType.None
% * DeviceType.Error % * DeviceType.Error
%
properties % Standard properties to be set by user properties % Standard properties to be set by user
% mode (DeviceMode.{Type}): Sensor mode in which the value will be read. By default, % mode (DeviceMode.{Type}): Sensor mode in which the value will be read. By default,
...@@ -355,16 +344,18 @@ classdef Sensor < MaskedHandle ...@@ -355,16 +344,18 @@ classdef Sensor < MaskedHandle
% debug (bool): *[OPTIONAL]* % debug (bool): *[OPTIONAL]*
% mode (DeviceMode.{Type}): *[OPTIONAL]* % mode (DeviceMode.{Type}): *[OPTIONAL]*
% %
% ::
%
% Example: % Example:
% b = EV3(); |br| % brick = EV3()
% b.connect('bt', 'serPort', '/dev/rfcomm0'); |br| % brick.connect('bt', 'serPort', '/dev/rfcomm0');
% %
% % use the following line: % % use the following line:
% b.sensor1.setProperties('debug', 'on', 'mode', DeviceMode.Color.Ambient); |br| % brick.sensor1.setProperties('debug', 'on', 'mode', DeviceMode.Color.Ambient);
% %
% % Instead of: % % Instead of:
% b.sensor1.debug = 'on'; |br| % brick.sensor1.debug = 'on';
% b.sensor1.mode = DeviceMode.Color.Ambient; |br| % brick.sensor1.mode = DeviceMode.Color.Ambient;
% %
p = inputParser(); p = inputParser();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment