tweaks of blocks

This commit is contained in:
Peli de Halleux 2017-12-14 13:07:10 -08:00
parent 11a88a9d94
commit 81fcbb6916
2 changed files with 7 additions and 5 deletions

View File

@ -57,7 +57,7 @@
"motors.mediumMotorB|block": "medium B", "motors.mediumMotorB|block": "medium B",
"motors.mediumMotorC|block": "medium C", "motors.mediumMotorC|block": "medium C",
"motors.mediumMotorD|block": "medium D", "motors.mediumMotorD|block": "medium D",
"motors.stopAllMotors|block": "stop all `icons.motorLarge`", "motors.stopAllMotors|block": "stop all motors",
"motors|block": "motors", "motors|block": "motors",
"output|block": "output", "output|block": "output",
"screen|block": "screen", "screen|block": "screen",

View File

@ -78,8 +78,8 @@ namespace motors {
/** /**
* Stops all motors * Stops all motors
*/ */
//% blockId=motorStopAll block="stop all `icons.motorLarge`" //% blockId=motorStopAll block="stop all motors"
//% weight=10 blockGap=8 //% weight=19
export function stopAllMotors() { export function stopAllMotors() {
const b = mkCmd(Output.ALL, DAL.opOutputStop, 0) const b = mkCmd(Output.ALL, DAL.opOutputStop, 0)
writePWM(b) writePWM(b)
@ -272,6 +272,7 @@ namespace motors {
/** /**
* Clears the motor count * Clears the motor count
*/ */
//%
clearCount() { clearCount() {
this.__init(); this.__init();
const b = mkCmd(this._port, DAL.opOutputClearCount, 0) const b = mkCmd(this._port, DAL.opOutputClearCount, 0)
@ -287,7 +288,7 @@ namespace motors {
* Resets the motor and clears any synchronization * Resets the motor and clears any synchronization
*/ */
//% blockId=motorReset block="reset `icons.motorLarge` %motor" //% blockId=motorReset block="reset `icons.motorLarge` %motor"
//% weight=1 //% weight=20
reset() { reset() {
this.__init(); this.__init();
reset(this._port); reset(this._port);
@ -317,6 +318,7 @@ namespace motors {
//% blockId=motorTurn block="turn `icons.motorLarge` %motor|by %value|%unit|at %speed|% turn %turnRadio" //% blockId=motorTurn block="turn `icons.motorLarge` %motor|by %value|%unit|at %speed|% turn %turnRadio"
//% weight=9 blockGap=8 //% weight=9 blockGap=8
//% turnRatio.min=-200 turnRatio=200 //% turnRatio.min=-200 turnRatio=200
//% inlineInputMode=inline
turn(value: number, unit: MoveUnit, speed: number, turnRatio: number) { turn(value: number, unit: MoveUnit, speed: number, turnRatio: number) {
this.output(value, unit, speed, turnRatio); this.output(value, unit, speed, turnRatio);
} }