NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
int MSReadValue ( const byte  port,
const byte  i2caddr,
const byte  reg,
const byte  numbytes 
)
inline

Read a mindsensors device value.

Read a one, two, or four byte value from a mindsensors sensor. The value must be stored with the least signficant byte (LSB) first (i.e., little endian). Returns a boolean value indicating whether or not the operation completed successfully. The port must be configured as a Lowspeed port before using this function.

Parameters
portThe sensor port. See Input port constants.
i2caddrThe sensor I2C address. See sensor documentation for this value.
regThe device register to read.
numbytesThe number of bytes to read. Only 1, 2 or 4 byte values are supported.
Returns
The function call result.
Examples:
ex_MSReadValue.nxc.