motorHat controller
Needs to be initialized with init().
- Source:
- See:
-
- Use MotorHat() for object creation.
- Use module:MotorHat~motorhat#init for object initialization.
Members
(static, constant) dclib :module:MotorHat/DC
DC Controller Factory
Type:
(static, constant) servolib :module:MotorHat/Servo
Servo Controller Factory
Type:
(static, constant) stepperlib :module:MotorHat/Stepper
Stepper Controller Factory
Type:
(constant) dcs :Array.<module:MotorHat/DC~dC>
Array of initialized DC controllers
Type:
- Array.<module:MotorHat/DC~dC>
- Source:
(constant) servos :Array.<module:MotorHat/Servo~servo>
Array of initialized Servo controllers
Type:
- Array.<module:MotorHat/Servo~servo>
- Source:
(constant) steppers :Array.<module:MotorHat/Stepper~stepper>
Array of initialized Stepper controllers
Type:
- Array.<module:MotorHat/Stepper~stepper>
- Source:
Methods
init(cb) → {module:MotorHat~motorhat}
Initialize the motorHat library instance.
Instantiates the individual Motor/Servo/Stepper controllers and initializes them.
Parameters:
Name | Type | Description |
---|---|---|
cb |
Optional node style callback for asynch initialization |
- Source:
Returns:
Returns initialized motorHat object (self), either directly
or in second parameter to callback if callback provided, to enable chaining.