From 81fcbb69164e92779779c12847664b36c4722319 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 14 Dec 2017 13:07:10 -0800 Subject: [PATCH] tweaks of blocks --- libs/core/_locales/core-strings.json | 2 +- libs/core/output.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/core/_locales/core-strings.json b/libs/core/_locales/core-strings.json index 4a8cd96c..bf557bb5 100644 --- a/libs/core/_locales/core-strings.json +++ b/libs/core/_locales/core-strings.json @@ -57,7 +57,7 @@ "motors.mediumMotorB|block": "medium B", "motors.mediumMotorC|block": "medium C", "motors.mediumMotorD|block": "medium D", - "motors.stopAllMotors|block": "stop all `icons.motorLarge`", + "motors.stopAllMotors|block": "stop all motors", "motors|block": "motors", "output|block": "output", "screen|block": "screen", diff --git a/libs/core/output.ts b/libs/core/output.ts index 9b7fd2c0..f95b6a33 100644 --- a/libs/core/output.ts +++ b/libs/core/output.ts @@ -78,8 +78,8 @@ namespace motors { /** * Stops all motors */ - //% blockId=motorStopAll block="stop all `icons.motorLarge`" - //% weight=10 blockGap=8 + //% blockId=motorStopAll block="stop all motors" + //% weight=19 export function stopAllMotors() { const b = mkCmd(Output.ALL, DAL.opOutputStop, 0) writePWM(b) @@ -272,6 +272,7 @@ namespace motors { /** * Clears the motor count */ + //% clearCount() { this.__init(); const b = mkCmd(this._port, DAL.opOutputClearCount, 0) @@ -287,12 +288,12 @@ namespace motors { * Resets the motor and clears any synchronization */ //% blockId=motorReset block="reset `icons.motorLarge` %motor" - //% weight=1 + //% weight=20 reset() { this.__init(); reset(this._port); delete this._follower; - } + } /** * Synchronizes a follower motor to this motor @@ -317,6 +318,7 @@ namespace motors { //% blockId=motorTurn block="turn `icons.motorLarge` %motor|by %value|%unit|at %speed|% turn %turnRadio" //% weight=9 blockGap=8 //% turnRatio.min=-200 turnRatio=200 + //% inlineInputMode=inline turn(value: number, unit: MoveUnit, speed: number, turnRatio: number) { this.output(value, unit, speed, turnRatio); }