Skip to content

Commit

Permalink
Update bbn_m5atomS3_lite_TFminiS_range_lidar.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrouch authored Nov 12, 2024
1 parent 53c004f commit e8cc0af
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
//#define RXD2 G16 // Green on the Lidar
//#define TXD2 G17 // White on the Lidar


int i;
unsigned char check;
int dist; // actual distance measurements of LiDAR
unsigned char uart[9]; // save data measured by LiDAR
Expand Down Expand Up @@ -88,7 +86,6 @@ void Get_Lidar_data() {
if (uart[8] == check) {
dist = uart[2] + uart[3] * 256; // the distance in cm
int percent = 0;

if (dist <= 200) { // dist in cm, so 200 cm = 2 meters
percent = (200 - dist) * 100 / 200; // calculate percentage
}
Expand Down

0 comments on commit e8cc0af

Please sign in to comment.