Firmware-830 Function-111

From I-CubeX Wiki
Revision as of 15:29, 13 May 2023 by Admin (talk | contribs) (AIR2D (111, 6Fh))
Jump to: navigation, search

AIR2D (111, 6Fh)

The AIR2D function enables output of the Air2D 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:

Air2D v1.0, v1.1

FP Data output in host mode Data output in stand-alone mode
Default Air Pressure [1..120]; a 32-bit IEEE-754 float value representing [1..120] kPa, sent in 5 bytes (MSB .. LSB) Air Pressure [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
Air Temperature [-40..85]; a 32-bit IEEE-754 float value representing [-40..85] ºC sent in 5 bytes (MSB .. LSB) Air Temperature [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
Absolute Altitude [-1450..25921]; a 32-bit IEEE-754 float representing [-1450..25921] m value sent in 5 bytes (MSB .. LSB) Absolute Altitude [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
Relative Altitude [-273716..273716]; a 32-bit IEEE-754 float representing [-273716..273716] m value sent in 5 bytes (MSB .. LSB) Relative Altitude [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
"1" Air Pressure [1..120]; a 32-bit IEEE-754 float value representing [1..120] kPa, sent in 5 bytes (MSB .. LSB) Air Pressure [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
"2" Air Temperature [-40..85]; a 32-bit IEEE-754 float representing [-40..85] ºC value sent in 5 bytes (MSB .. LSB) Air Temperature [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
"3" Absolute Altitude [-1450..25921]; a 32-bit IEEE-754 float representing [-1450..25921] m value sent in 5 bytes (MSB .. LSB) Absolute Altitude [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)
"4" Relative Altitude [-273716..273716]; a 32-bit IEEE-754 float value representing [-273716..273716] m sent in 5 bytes (MSB .. LSB) Relative Altitude [0..127] or [0..16383]; an unsigned 7-bit or 14-bit value sent as one or two bytes (LSB, MSB)

Method "1" represents methods 1, 11, 21, etc., with the same holding for methods "2", "3" and "4".

Increasing the method number in steps of 10 in the range of 0..49, decreases the sensor resolution by reducing the internal oversampling rate which reduces power consumption.


Example:

In order to enable the AIR2D function to get the air pressure from an Air2D sensor with I2C device address 119 (default Magnetic3D I2C device address) connected to the 7th I2C port, the following message is sent:

240, 125, 0 {DEV}, 8 {FUNCTION}, 6 {port}, 119 {device address}, 111 {AIR2D function}, 1 {air pressure}, 247 (F0h, 7Dh, 00h, 08h, 06h, 77h, 6Fh, 01h, 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.

Other settings of the Air2D sensor can be effectuated by using I2C commands such as I2C WRITE and I2C READ. See also the datasheet linked from the Air2D webpage.