Data Sheet

Core Spartan Documentation Modern Robotics, Inc
Version 3.0.3 Page 40
int available(void)
Checks to see if there is any data left in the buffers from a previous request.
while(sensor.available())
value = sensor.read();
…or…
if(sensor.available != 0)
value = sensor.read();
void write(int location, unsigned char data)
Complete a signal byte write to a selected register location. The parameter
location refers to the location in which the data is to be written. The parameter
data is the size of one byte which allows data to be 0x00 0xFF (0 255).
sensor.write(0x03, 0x43);
…or…
sensor.write(0x04, 175);
void write(int location, unsigned char data[], int length)
Complete a multiple byte write to concurrent registers. The parameter location
refers to the location in which the data is to be written. The parameter data[] is
an array of bytes which allows each piece of data to be 0x00 0xFF (0 255).
Length if the number of bytes being written to the I2C sensor. The location is
0x03 and the length is 4, then register 0x03, 0x04, 0x05 and 0x06 will be written
to.
sensor.write(0x03, data, 4);
…or…
sensor.write(0x04, {3, 0x43, 7}, 3);