From 13905ad867482605f4e734dbfb9eb7b637f3b322 Mon Sep 17 00:00:00 2001 From: lzty634158 Date: Mon, 12 Nov 2018 16:36:57 +0800 Subject: [PATCH] fix csb float --- main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.ts b/main.ts index 3813868..4434419 100644 --- a/main.ts +++ b/main.ts @@ -250,7 +250,7 @@ namespace mbit_Sensor { // read pulse let d = pins.pulseIn(Echo, PulseValue.High, 23200); - return d / 58; + return Math.floor(d / 58); } } @@ -912,7 +912,7 @@ namespace mbit_Robot { // read pulse let d = pins.pulseIn(DigitalPin.P15, PulseValue.High, 43200); - return d / 58; + return Math.floor(d / 58); } //% blockId=mbit_Music_Car block="Music_Car|%index"