Skip to content

Commit 5a86ee7

Browse files
committed
improve documentation
1 parent 3f8a6fa commit 5a86ee7

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

src/devices/absolutemotor.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export class AbsoluteMotor extends TachoMotor {
4040
* @method AbsoluteMotor#gotoAngle
4141
* @param {number} angle Absolute position the motor should go to (degrees from 0).
4242
* @param {number} [speed=100] For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100.
43-
* @param {boolean} interrupt If true, previous commands are discarded.
44-
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (ie. once the motor is finished).
43+
* @param {boolean} [interrupt=false] If true, previous commands are discarded.
44+
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (i.e. once the motor is finished).
4545
*/
4646
public gotoAngle (angle: [number, number] | number, speed: number = 100, interrupt: boolean = false) {
4747
if (!this.isVirtualPort && angle instanceof Array) {
@@ -72,7 +72,7 @@ export class AbsoluteMotor extends TachoMotor {
7272
* Real zero is marked on Technic angular motors (SPIKE Prime). It is also available on Technic linear motors (Control+) but is unmarked.
7373
* @method AbsoluteMotor#gotoRealZero
7474
* @param {number} [speed=100] Speed between 1 - 100. Note that this will always take the shortest path to zero.
75-
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (ie. once the motor is finished).
75+
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (i.e. once the motor is finished).
7676
*/
7777
public gotoRealZero (speed: number = 100) {
7878
return new Promise<Consts.CommandFeedback>((resolve) => {
@@ -101,8 +101,8 @@ export class AbsoluteMotor extends TachoMotor {
101101
/**
102102
* Reset zero to current position
103103
* @method AbsoluteMotor#resetZero
104-
* @param {boolean} interrupt If true, previous commands are discarded.
105-
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (ie. once the motor is finished).
104+
* @param {boolean} [interrupt=false] If true, previous commands are discarded.
105+
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (i.e. once the motor is finished).
106106
*/
107107
public resetZero (interrupt: boolean = false) {
108108
const data = Buffer.from([0x51, 0x02, 0x00, 0x00, 0x00, 0x00]);

src/devices/basicmotor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class BasicMotor extends Device {
1919
* Set the motor power.
2020
* @method BasicMotor#setPower
2121
* @param {number} power For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0.
22-
* @param {boolean} interrupt If true, previous commands are discarded.
22+
* @param {boolean} [interrupt=false] If true, previous commands are discarded.
2323
* @returns {Promise<CommandFeedback>} Resolved upon completion of command.
2424
*/
2525
public setPower (power: number, interrupt: boolean = false) {

src/devices/light.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class Light extends Device {
2020
* @method Light#setBrightness
2121
* @param {number} brightness Brightness value between 0-100 (0 is off)
2222
* @param {number} brightness Brightness value between 0-100 (0 is off)
23-
* @param {boolean} interrupt If true, previous commands are discarded.
23+
* @param {boolean} [interrupt=false] If true, previous commands are discarded.
2424
* @returns {Promise<CommandFeedback>} Resolved upon completion of command.
2525
*/
2626
public setBrightness (brightness: number, interrupt: boolean = false) {

src/devices/piezobuzzer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class PiezoBuzzer extends Device {
2121
* @method PiezoBuzzer#playTone
2222
* @param {number} frequency
2323
* @param {number} time How long the tone should play for (in milliseconds).
24-
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (ie. once the tone has finished playing).
24+
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (i.e. once the tone has finished playing).
2525
*/
2626
public playTone (frequency: number, time: number) {
2727
return new Promise<Consts.CommandFeedback>((resolve) => {

src/devices/tachomotor.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ export class TachoMotor extends BasicMotor {
6767
* @method TachoMotor#setAccelerationTime
6868
* @param {number} time How long acceleration should last (in milliseconds).
6969
* @param {number} profile 0 by default
70-
* @param {boolean} interrupt If true, previous commands are discarded.
71-
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (ie. once the motor is finished).
70+
* @param {boolean} [interrupt=false] If true, previous commands are discarded.
71+
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (i.e. once the motor is finished).
7272
*/
7373
public setAccelerationTime (time: number, profile: number = 0x00, interrupt: boolean = false) {
7474
const message = Buffer.from([0x05, 0x00, 0x00, profile]);
@@ -82,8 +82,8 @@ export class TachoMotor extends BasicMotor {
8282
* @method TachoMotor#setDecelerationTime
8383
* @param {number} time How long deceleration should last (in milliseconds).
8484
* @param {number} profile 0 by default
85-
* @param {boolean} interrupt If true, previous commands are discarded.
86-
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (ie. once the motor is finished).
85+
* @param {boolean} [interrupt=false] If true, previous commands are discarded.
86+
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (i.e. once the motor is finished).
8787
*/
8888
public setDecelerationTime (time: number, profile: number = 0x00, interrupt: boolean = true) {
8989
const message = Buffer.from([0x06, 0x00, 0x00, profile]);
@@ -97,8 +97,8 @@ export class TachoMotor extends BasicMotor {
9797
* @method TachoMotor#setSpeed
9898
* @param {number} speed For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100. Stop is 0.
9999
* @param {number} time How long the motor should run for (in milliseconds).
100-
* @param {boolean} interrupt If true, previous commands are discarded.
101-
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (ie. once the motor is finished).
100+
* @param {boolean} [interrupt=false] If true, previous commands are discarded.
101+
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (i.e. once the motor is finished).
102102
*/
103103
public setSpeed (speed: [number, number] | number, time: number | undefined, interrupt: boolean = false) {
104104
if (!this.isVirtualPort && speed instanceof Array) {
@@ -133,8 +133,8 @@ export class TachoMotor extends BasicMotor {
133133
* @method TachoMotor#rotateByDegrees
134134
* @param {number} degrees How much the motor should be rotated (in degrees).
135135
* @param {number} [speed=100] For forward, a value between 1 - 100 should be set. For reverse, a value between -1 to -100.
136-
* @param {boolean} interrupt If true, previous commands are discarded.
137-
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (ie. once the motor is finished).
136+
* @param {boolean} [interrupt=false] If true, previous commands are discarded.
137+
* @returns {Promise<CommandFeedback>} Resolved upon completion of command (i.e. once the motor is finished).
138138
*/
139139
public rotateByDegrees (degrees: number, speed: [number, number] | number, interrupt: boolean = false) {
140140
if (!this.isVirtualPort && speed instanceof Array) {

0 commit comments

Comments
 (0)