This lib was build for reading the 3 IMU unit sensors of Altimu10v4 board (https://www.pololu.com/product/2470).
Revision 4:d141a3e5531e, committed 2021-04-04
- Comitter:
- renanbmx123
- Date:
- Sun Apr 04 14:37:39 2021 +0000
- Parent:
- 3:3613e9a0edb1
- Commit message:
- Refatorando para o mbed-os 6
Changed in this revision
ALTIMU.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 3613e9a0edb1 -r d141a3e5531e ALTIMU.cpp --- a/ALTIMU.cpp Tue Nov 06 16:41:50 2018 +0000 +++ b/ALTIMU.cpp Sun Apr 04 14:37:39 2021 +0000 @@ -80,9 +80,10 @@ // Write a byte in a register address. bool Altimu::write_reg(int addr_i2c,int addr_reg, char v) { - char data[2] = {addr_reg, v}; // + uint8_t data[2] = {(uint8_t)addr_reg, (uint8_t)v}; // // return boolean value of write operation, if fails return 0, else 1. - return Altimu::_ALTIMU.write(addr_i2c, data, 2) == 0; + //write (int address, const char *data, int length, bool repeated=false) + return Altimu::_ALTIMU.write(addr_i2c, (char *)data, 2) == 0; } // Read a byte from register bool Altimu::read_reg(int addr_i2c,int addr_reg, char *v)