Firmware-820 Function-112

From I-CubeX Wiki
Jump to: navigation, search

ANGLED (112, 70h)

The ANGLED function enables output of the AngleD sensor data in both host and stand-alone mode. In host mode the sensor data is output in I2C DATA messages. In stand-alone mode the sensor data is output according to the stand-alone mode settings of the input number that equals the I2C port number. The following methods can be selected using the FUNCTION command’s method/parameter FP:

AngleD v1.0, v1.1, v1.2

FP Data output in host mode Data output in stand-alone mode
0..127 Angle [0..4095]; a signed two’s complement 14-bit value representing [0..360] degrees sent as nibbles in four bytes (MSB .. LSB) Angle [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value representing [0..360] degrees sent as one or two bytes (LSB, MSB)

Example:

In order to enable the ANGLED function to get the angle data from an AngleD sensor with I2C device address 54 (default AngleD I2C device address) connected to the 7th I2C port, the following message is sent:

240, 125, 0 {DEV}, 8 {FUNCTION}, 6 {port}, 54 {device address}, 112 {ANGLED function}, 0 {angle}, 247 (F0h, 7Dh, 00h, 08h, 06h, 36h, 70h, 00h, F7h)

In host mode raw sensor data will be output immediately in I2C DATA messages. In stand-alone mode a suitable configuration has to be set using the EDIT CONFIG command before any MIDI messages will be output.