Merge pull request #63 from Microsoft/speedispower

use speed when setting power
This commit is contained in:
Peli de Halleux 2017-11-29 21:22:32 -08:00 committed by GitHub
commit 5676103052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,7 +97,8 @@ namespace motors {
power(power: number) { power(power: number) {
power = Math.clamp(-100, 100, power >> 0); power = Math.clamp(-100, 100, power >> 0);
const b = mkCmd(this.port, DAL.opOutputPower, 1) // per LEGO: call it power, use speed
const b = mkCmd(this.port, DAL.opOutputSpeed, 1)
b.setNumber(NumberFormat.Int8LE, 2, power) b.setNumber(NumberFormat.Int8LE, 2, power)
writePWM(b) writePWM(b)
if (power) { if (power) {