From e94e6f0c7e00176df85a65a8d6935a802cf48943 Mon Sep 17 00:00:00 2001 From: Mikhail Grushinskiy Date: Thu, 19 Dec 2024 17:06:55 -0500 Subject: [PATCH] Update bbn_m5atomS3_lite_JSN-SR04T.ino --- bbn_m5atomS3_lite_JSN-SR04T/bbn_m5atomS3_lite_JSN-SR04T.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bbn_m5atomS3_lite_JSN-SR04T/bbn_m5atomS3_lite_JSN-SR04T.ino b/bbn_m5atomS3_lite_JSN-SR04T/bbn_m5atomS3_lite_JSN-SR04T.ino index fd950c7..c93bdcb 100644 --- a/bbn_m5atomS3_lite_JSN-SR04T/bbn_m5atomS3_lite_JSN-SR04T.ino +++ b/bbn_m5atomS3_lite_JSN-SR04T/bbn_m5atomS3_lite_JSN-SR04T.ino @@ -20,5 +20,7 @@ void setup() { void loop() { delay(1000); float distance_cm = (float)sonar.ping_median(5) * factor; - gen_nmea0183_xdr("$BBXDR,D,%.2f,M,Range_JSN_S04T", distance_cm / 100.0); + if (fabs(distance_cm) > 0.001) { + gen_nmea0183_xdr("$BBXDR,D,%.2f,M,Range_JSN_S04T", distance_cm / 100.0); + } }