Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:bd9e4d198947, committed 2022-02-09
- Comitter:
- vermaelen
- Date:
- Wed Feb 09 14:21:29 2022 +0000
- Parent:
- 0:417c1bd45a3c
- Child:
- 2:d6e45ac03963
- Commit message:
- first change of LIDARLitev3
Changed in this revision
| LIDARLite_v3HP.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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 */