update LIDARLite_v3HP just to be functionnal. IUT GEII NICE
Diff: LIDARLite_v3HP.cpp
- Revision:
- 1:bd9e4d198947
- Parent:
- 0:417c1bd45a3c
- Child:
- 2:d6e45ac03963
diff -r 417c1bd45a3c -r bd9e4d198947 LIDARLite_v3HP.cpp --- a/LIDARLite_v3HP.cpp Fri Sep 20 14:15:12 2019 +0000 +++ b/LIDARLite_v3HP.cpp Wed Feb 09 14:21:29 2022 +0000 @@ -261,14 +261,15 @@ uint16_t LIDARLite_v3HP::readDistance(const uint8_t &lidarliteAddress) { uint16_t distance; - uint8_t dataBytes[2]; + uint8_t dataByteHigh; + uint8_t dataByteLow; // Read two bytes from register 0x0f and 0x10 (autoincrement) - read(0x0f, dataBytes, 2, lidarliteAddress); - - // Shift high byte and add to low byte - distance = (dataBytes[0] << 8) | dataBytes[1]; - + // ca marche pas !!!! + // read(0x0f, dataBytes, 2, lidarliteAddress); + read(0x0f, dataByteHigh, 1, lidarliteAddress); + read(0x0f, dataByteLow, 1, lidarliteAddress); + distance =(dataByteHigh<<8)+dataByteLow; return (distance); } /* LIDARLite_v3HP::readDistance */