changed getMotorPosition() to use the Boost.motor()-function instead of accessing the _motors-property directly

This commit is contained in:
Kevin Andersen 2019-04-09 08:47:00 -04:00
parent ecbbacd4c0
commit c664fca9d7

View file

@ -1794,8 +1794,8 @@ class Scratch3BoostBlocks {
log.warn('Asked for a motor position that doesnt exist!');
return false;
}
if (portID && this.motor([portID])) {
return MathUtil.wrapClamp(this._peripheral._motors[portID].position, 0, 360);
if (portID && this.motor(portID)) {
return MathUtil.wrapClamp(this.motor(portID).position, 0, 360);
}
return 0;
}