Thresholds (#222)

* add threshold blocks

* updated strings

* added gap

* reorg color/gyro blocks

* fixing sound names

* adding stop block

* fixing exanmples
This commit is contained in:
Peli de Halleux
2018-01-09 12:46:48 -08:00
committed by GitHub
parent 9890f2340a
commit 892a2d585f
20 changed files with 131 additions and 69 deletions

View File

@ -71,7 +71,7 @@
"motors.MotorBase.setBrake": "Sets the automatic brake on or off when the motor is off",
"motors.MotorBase.setBrake|param|brake": "a value indicating if the motor should break when off",
"motors.MotorBase.setReversed": "Reverses the motor polarity",
"motors.MotorBase.setSpeed": "Sets the motor speed for limited time or distance",
"motors.MotorBase.setSpeed": "Sets the motor speed for limited time or distance.",
"motors.MotorBase.setSpeed|param|speed": "the speed from ``100`` full forward to ``-100`` full backward, eg: 50",
"motors.MotorBase.setSpeed|param|unit": "(optional) unit of the value",
"motors.MotorBase.setSpeed|param|value": "(optional) measured distance or rotation",

View File

@ -58,6 +58,7 @@
"motors.MotorBase.setBrake|block": "set %motor|brake %brake",
"motors.MotorBase.setReversed|block": "set %motor|reversed %reversed",
"motors.MotorBase.setSpeed|block": "set %motor|speed to %speed=motorSpeedPicker|%",
"motors.MotorBase.stop|block": "%motors|stop",
"motors.SynchedMotorPair.steer|block": "steer %chassis|turn ratio %turnRatio|speed %speed=motorSpeedPicker|%",
"motors.SynchedMotorPair.tank|block": "tank %motors|%speedLeft=motorSpeedPicker|%|%speedRight=motorSpeedPicker|%",
"motors.largeAB|block": "large A+B",

View File

@ -187,7 +187,9 @@ namespace motors {
/**
* Stops the motor(s).
*/
//%
//% weight=6 blockGap=8
//% group="Move"
//% blockId=motorStop block="%motors|stop"
stop() {
this.init();
stop(this._port, this._brake);
@ -203,7 +205,7 @@ namespace motors {
}
/**
* Sets the motor speed for limited time or distance
* Sets the motor speed for limited time or distance.
* @param speed the speed from ``100`` full forward to ``-100`` full backward, eg: 50
* @param value (optional) measured distance or rotation
* @param unit (optional) unit of the value