Merge pull request #74 from Microsoft/powertospeed
some speed renamings
This commit is contained in:
commit
e649a167cd
@ -93,7 +93,7 @@ namespace motors {
|
|||||||
*/
|
*/
|
||||||
//% blockId=motorSetSpeed block="set speed `icons.motorLarge` %motor|to %speed|%"
|
//% blockId=motorSetSpeed block="set speed `icons.motorLarge` %motor|to %speed|%"
|
||||||
//% weight=99 group="Motors" blockGap=8
|
//% weight=99 group="Motors" blockGap=8
|
||||||
//% power.min=-100 power.max=100
|
//% speed.min=-100 speed.max=100
|
||||||
setSpeed(speed: number) {
|
setSpeed(speed: number) {
|
||||||
speed = Math.clamp(-100, 100, speed >> 0);
|
speed = Math.clamp(-100, 100, speed >> 0);
|
||||||
|
|
||||||
@ -113,11 +113,11 @@ namespace motors {
|
|||||||
* Moves the motor by a number of degrees
|
* Moves the motor by a number of degrees
|
||||||
* @param degrees the angle to turn the motor
|
* @param degrees the angle to turn the motor
|
||||||
* @param angle the degrees to rotate, eg: 360
|
* @param angle the degrees to rotate, eg: 360
|
||||||
* @param power the power from ``100`` full forward to ``-100`` full backward, eg: 50
|
* @param speed the speed from ``100`` full forward to ``-100`` full backward, eg: 50
|
||||||
*/
|
*/
|
||||||
//% blockId=motorMove block="move `icons.motorLarge` %motor|by %angle|degrees at %power|%"
|
//% blockId=motorMove block="move `icons.motorLarge` %motor|by %angle|degrees at %speed|%"
|
||||||
//% weight=98 group="Motors" blockGap=8
|
//% weight=98 group="Motors" blockGap=8
|
||||||
//% power.min=-100 power.max=100
|
//% speed.min=-100 speed.max=100
|
||||||
move(angle: number, power: number) {
|
move(angle: number, power: number) {
|
||||||
angle = angle >> 0;
|
angle = angle >> 0;
|
||||||
power = Math.clamp(-100, 100, power >> 0);
|
power = Math.clamp(-100, 100, power >> 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user