Constructor
new Wheel(enablePin, controlPins, calibrationFactor)
Parameters:
Name | Type | Description |
---|---|---|
enablePin |
Pin | The pin used to enable the motor of the wheel |
controlPins |
array | An array of two Pins used to control the wheel |
calibrationFactor |
float | A value which is multiplied by speed before applying |
- License:
- MIT
- Source:
Methods
backward()
Sets the wheel to go backward
forward()
Sets the wheel to go forward
getSpeed() → {float}
Returns the speed set for the wheel
Returns:
The value set as current speed
- Type
- float
setSpeed(speed)
Sets the speed of the wheel
Parameters:
Name | Type | Description |
---|---|---|
speed |
float | The speed to set (between 0.0 and 1.0) |
stop()
Sets the wheel to stopped
writeToControlPins(v0, v1)
Write values to control pins
Parameters:
Name | Type | Description |
---|---|---|
v0 |
int | Value to write to controlPin[0] |
v1 |
int | Value to write to controlPin[1] |