Skip to content

Commit

Permalink
Motor speed invertedFactor usage (#1029)
Browse files Browse the repository at this point in the history
* invertedFactor-in-speed-method

Added use of the invertedFactor() method in the speed() method. Done in the same way as for the case of the angle() method;

* Removed unused enum OutputType

I don't understand what this enum is for... I think it's for large and medium motor encoders. But it was not used.

* Revert "Removed unused enum OutputType"

This reverts commit 76a9517.
  • Loading branch information
THEb0nny authored Aug 29, 2023
1 parent da70c19 commit c2ad46d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/core/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ namespace motors {
//% help=motors/motor/speed
speed(): number {
this.init();
return getMotorData(this._port).actualSpeed;
return getMotorData(this._port).actualSpeed * this.invertedFactor();
}

/**
Expand Down

0 comments on commit c2ad46d

Please sign in to comment.