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

Add support for HT-sensors

-> Magnetic Compass, Accelerometer and Color
parent 38339a56
No related branches found
No related tags found
No related merge requests found
classdef HTAccelerometer < uint8
enumeration
Acceleration (0)
AccelerationAllAxes (1)
end
end
classdef HTColor < uint8
enumeration
Col (0)
Red (1)
Green (2)
Blue (3)
White (4)
Raw (5)
Nrm (6)
All (7)
end
end
\ No newline at end of file
classdef HTCompass < uint8
enumeration
Degrees (0)
end
end
...@@ -34,6 +34,12 @@ function mode = DeviceMode(type, modeNo) ...@@ -34,6 +34,12 @@ function mode = DeviceMode(type, modeNo)
mode = DeviceMode.Gyro(modeNo); mode = DeviceMode.Gyro(modeNo);
case DeviceType.InfraRed case DeviceType.InfraRed
mode = DeviceMode.InfraRed(modeNo); mode = DeviceMode.InfraRed(modeNo);
case DeviceType.HTColor
mode = DeviceMode.HTColor(modeNo);
case DeviceType.HTCompass
mode = DeviceMode.HTCompass(modeNo);
case DeviceType.HTAccelerometer
mode = DeviceMode.HTAccelerometer(modeNo);
otherwise otherwise
mode = DeviceMode.Default.Undefined; % Need to think about this... mode = DeviceMode.Default.Undefined; % Need to think about this...
end end
......
...@@ -13,6 +13,9 @@ classdef DeviceType < uint8 ...@@ -13,6 +13,9 @@ classdef DeviceType < uint8
UltraSonic (30) UltraSonic (30)
Gyro (32) Gyro (32)
InfraRed (33) InfraRed (33)
HTColor (54)
HTCompass (56)
HTAccelerometer (58)
Unknown (125) Unknown (125)
None (126) None (126)
Error (127) Error (127)
......
...@@ -59,6 +59,18 @@ function isValid = isModeValid(mode, type) ...@@ -59,6 +59,18 @@ function isValid = isModeValid(mode, type)
if ~strcmp(class(mode), 'DeviceMode.InfraRed') if ~strcmp(class(mode), 'DeviceMode.InfraRed')
isValid = false; isValid = false;
end end
case DeviceType.HTColor
if ~strcmp(class(mode), 'DeviceMode.HTColor')
isValid = false;
end
case DeviceType.HTCompass
if ~strcmp(class(mode), 'DeviceMode.HTCompass')
isValid = false;
end
case DeviceType.HTAccelerometer
if ~strcmp(class(mode), 'DeviceMode.HTAccelerometer')
isValid = false;
end
otherwise otherwise
isValid = false; isValid = false;
end end
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment