DeviceI2C read()
Read a byte from the currently addressed device. Must be preceded by a proper PortI2C start() call.
#include <Ports.h>
#include <RF12.h> // needed to avoid a linker error :(
PortI2C myBus (1 /*, PortI2C::KHZ400 */);
DeviceI2C myDev (myBus, 0x77);
byte myDev.read(byte last);
Parameters
last
Indicates whether this is the last byte to read. Used to respond to the write with a positive or negative acknowledgement. Pass 1 if reading the last byte, otherwise pass 0 in "last" parameter.
Notes
This function is defined in both class PortI2C and in class DeviceI2C, and has the same effect in both.