Compare commits

..

4 Commits

Author SHA1 Message Date
64a9930c2e 1.2.4 2019-09-17 12:36:35 -07:00
5815e16647 update pxt reference (#914) 2019-09-17 12:36:11 -07:00
c4f5e425c2 1.2.3 2019-09-17 11:26:52 -07:00
361ae7a2d2 adding a few pause to allow motors to settle 2019-09-17 11:23:40 -07:00
2 changed files with 9 additions and 4 deletions

View File

@ -123,7 +123,8 @@ namespace motors {
//% help=motors/stop-all
export function stopAll() {
const b = mkCmd(Output.ALL, DAL.opOutputStop, 0)
writePWM(b)
writePWM(b);
pause(1);
}
/**
@ -132,6 +133,7 @@ namespace motors {
//% group="Move"
export function resetAllMotors() {
reset(Output.ALL)
pause(1);
}
interface MoveSchedule {
@ -259,6 +261,8 @@ namespace motors {
// allow 500ms for robot to settle
if (this._brake && this._brakeSettleTime > 0)
pause(this._brakeSettleTime);
else
pause(1); // give a tiny breather
}
protected pauseOnRun(stepsOrTime: number) {
@ -337,6 +341,7 @@ namespace motors {
// special: 0 is infinity
if (schedule.steps[0] + schedule.steps[1] + schedule.steps[2] == 0) {
this._run(schedule.speed);
pause(1);
return;
}
@ -700,7 +705,7 @@ namespace motors {
this.init();
speed = Math.clamp(-100, 100, speed >> 0);
if (!speed) {
stop(this._port, this._brake);
this.stop();
return;
}

View File

@ -1,6 +1,6 @@
{
"name": "pxt-ev3",
"version": "1.2.2",
"version": "1.2.4",
"description": "LEGO MINDSTORMS EV3 for Microsoft MakeCode",
"private": false,
"keywords": [
@ -40,7 +40,7 @@
},
"dependencies": {
"pxt-common-packages": "0.23.61",
"pxt-core": "4.0.9"
"pxt-core": "4.0.10"
},
"scripts": {
"test": "node node_modules/pxt-core/built/pxt.js travis"