Permalink
Browse files

add support for mindsensors.com GlideWheel-AS AngleSensor

  • Loading branch information...
dlech committed Nov 21, 2014
1 parent 0335563 commit 0bb5e72135f8abf789db5d061a78a26f6281ed2f
@@ -105,6 +105,7 @@ enum nxt_i2c_sensor_type {
HT_NXT_SUPER_PRO_SENSOR,
HT_NXT_SENSOR_MUX,
MS_8CH_SERVO,
MS_ANGLE_SENSOR,
MS_LIGHT_SENSOR_ARRAY,
NUM_NXT_I2C_SENSORS
};
@@ -129,6 +130,7 @@ enum nxt_i2c_sensor_type {
{ "ht-super-pro", HT_NXT_SUPER_PRO_SENSOR }, \
{ "ht-nxt-smux", HT_NXT_SENSOR_MUX }, \
{ "ms-8ch-servo", MS_8CH_SERVO }, \
{ "ms-angle-sensor", MS_ANGLE_SENSOR }, \

This comment has been minimized.

@in4lio

in4lio Nov 24, 2014

Maybe just "ms-angle" like "ht-nxt-angle")

This comment has been minimized.

@dlech

dlech Nov 24, 2014

Member

Yes, shorter is better if it doesn't loose meaning.

{ "ms-light-array", MS_LIGHT_SENSOR_ARRAY }, \
{ }
@@ -376,7 +376,7 @@ static struct i2c_driver nxt_i2c_sensor_driver = {
.remove = nxt_i2c_sensor_remove,
.class = I2C_CLASS_LEGOEV3,
.detect = nxt_i2c_sensor_detect,
.address_list = I2C_ADDRS(0x01, 0x02, 0x08, 0x0A, 0x58),
.address_list = I2C_ADDRS(0x01, 0x02, 0x08, 0x0A, 0x18, 0x58),
};
module_i2c_driver(nxt_i2c_sensor_driver);
@@ -1590,6 +1590,95 @@ const struct nxt_i2c_sensor_info nxt_i2c_sensor_defs[] = {
},
},
},
[MS_ANGLE_SENSOR] = {
/**
* @vendor_name: mindsensors.com
* @vendor_part_number: AngleSensor
* @vendor_part_name: GlideWheel-AS
* @vendor_website: http://www.mindsensors.com/index.php?module=pagemaster&PAGE_user_op=view_page&PAGE_id=173
* @default_address: 0x18
*/
.name = "ms-angle-sensor",
.vendor_id = "mndsnsrs",
.product_id = "AngSens",
.num_modes = 4,
.ms_mode_info = {
[0] = {
/**
* @description: Angle
* @value0: Angle
* @units_description: degrees
*/
.name = "MS-AS-ANGLE",
.data_sets = 1,
.data_type = MSENSOR_DATA_S32,
.units = "deg",
},
[1] = {
/**
* @description: High-precision angle
* @value0: Angle
* @units_description: degrees
*/
.name = "MS-AS-ANGLE2",
.raw_max = 360,
.si_max = 1800,
.data_sets = 1,
.decimals = 1,
.data_type = MSENSOR_DATA_S32,
.units = "deg",
},
[2] = {
/**
* @description: Rotational Speed
* @value0: Rotational Speed (-4000 to 4000)
* @units_description: revolutions per minute
*/
.name = "MS-AS-RPM",
.raw_max = 100,
.si_max = 100,
.data_sets = 1,
.units = "rpm",
.data_type = MSENSOR_DATA_S16,
},
[3] = {
/**
* [^mode3-value1]: Angle value times 2
* (i.e. value of 10 = angle of 5 degrees).
* Allows for 0.5 degree precision.
* [^mode3-value2]: Value needs to be converted to
* 16-bit signed integer. Example:
* `if (value2 > 32767) value2 = value2 - 65536`
*
* @description: All values
* @value0: Angle
* @value1: Angle x2
* @value1_footnote: [^mode3-value1]
* @value2: Rotational Speed
* @value2_footnote: [^mode3-value2]
*/
.name = "MS-AS-ALL",
.raw_max = 100,
.si_max = 100,
.data_sets = 3,
.data_type = MSENSOR_DATA_S32,
},
},
.i2c_mode_info = {
[0] = {
.read_data_reg = 0x42,
},
[1] = {
.read_data_reg = 0x46,
},
[2] = {
.read_data_reg = 0x4A,
},
[3] = {
.read_data_reg = 0x42,
},
},
},
[MS_LIGHT_SENSOR_ARRAY] = {
/**
* [^address]: The address is programmable. See manufacturer

0 comments on commit 0bb5e72

Please sign in to comment.