Class: Wheel

Wheel

Class representing a driving wheel.

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
Author:
  • Loris Tissino (http://loris.tissino.it)
License:
  • MIT
Source:

Methods

backward()

Sets the wheel to go backward
Source:

forward()

Sets the wheel to go forward
Source:

getSpeed() → {float}

Returns the speed set for the wheel
Source:
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)
Source:

stop()

Sets the wheel to stopped
Source:

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]
Source: