fix csb float
This commit is contained in:
parent
4bac2710ef
commit
13905ad867
4
main.ts
4
main.ts
|
|
@ -250,7 +250,7 @@ namespace mbit_Sensor {
|
||||||
|
|
||||||
// read pulse
|
// read pulse
|
||||||
let d = pins.pulseIn(Echo, PulseValue.High, 23200);
|
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
|
// read pulse
|
||||||
let d = pins.pulseIn(DigitalPin.P15, PulseValue.High, 43200);
|
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"
|
//% blockId=mbit_Music_Car block="Music_Car|%index"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue