29 void MPU9255::requestBytes(uint8_t address, uint8_t subAddress, uint8_t bytes)
31 Wire.beginTransmission(address);
32 Wire.write(subAddress);
33 Wire.endTransmission(
false);
34 Wire.requestFrom(address, bytes);
43 void MPU9255::readArray(uint8_t* output,
char size)
45 for(
char i = 0; i<size; i++)
47 output[i] = Wire.read();
57 uint8_t MPU9255::read(uint8_t address, uint8_t subAddress)
59 requestBytes(address,subAddress,1);
60 uint8_t data = Wire.read();
70 void MPU9255::write(uint8_t address, uint8_t subAddress, uint8_t data)
72 Wire.beginTransmission(address);
73 Wire.write(subAddress);
75 Wire.endTransmission();
84 void MPU9255::write_OR(uint8_t address, uint8_t subAddress, uint8_t data)
86 uint8_t c = read(address,subAddress);
88 write(address,subAddress,c);
97 void MPU9255::write_AND(uint8_t address, uint8_t subAddress, uint8_t data)
99 uint8_t c = read(address,subAddress);
101 write(address,subAddress,c);
Main header of the library.