API for the AdafruitMS1438 Motor Shield.
More...
This class implements support for the stepper and DC motors that can be connected to this Motor Shield. Note: the two servo connections are not controlled by the PCA9685 controller (or this class). They are connected directly to digital PWM pins 9 and 10 on the Arduino* breakout board.
An example using a DC motor connected to M3
An example using a stepper motor connected to M1 & M2
|
class | DCMOTORS_T |
|
class | DIRECTION_T |
|
class | STEPMOTORS_T |
|
AdafruitMS1438 constructor
- Parameters
-
bus | I2C bus to use |
address | Address for this sensor |
void disableMotor |
( |
AdafruitMS1438.DCMOTORS_T |
motor | ) |
|
Disables PWM output for a motor
- Parameters
-
void disableStepper |
( |
AdafruitMS1438.STEPMOTORS_T |
motor | ) |
|
Disable output for a stepper motor
- Parameters
-
motor | Stepper motor to disable |
void enableMotor |
( |
AdafruitMS1438.DCMOTORS_T |
motor | ) |
|
Enables PWM output for a motor
- Parameters
-
void enableStepper |
( |
AdafruitMS1438.STEPMOTORS_T |
motor | ) |
|
Enables output for a stepper motor
- Parameters
-
motor | Stepper motor to enable |
long getMillis |
( |
AdafruitMS1438.STEPMOTORS_T |
motor | ) |
|
Returns the number of milliseconds elapsed since initClock(...) was last called.
- Returns
- Elapsed milliseconds
void initClock |
( |
AdafruitMS1438.STEPMOTORS_T |
motor | ) |
|
void setMotorDirection |
( |
AdafruitMS1438.DCMOTORS_T |
motor, |
|
|
AdafruitMS1438.DIRECTION_T |
dir |
|
) |
| |
Sets the direction of a DC motor, clockwise or counterclockwise
- Parameters
-
motor | DC motor to configure |
dir | Direction to set the motor in |
void setMotorSpeed |
( |
AdafruitMS1438.DCMOTORS_T |
motor, |
|
|
int |
speed |
|
) |
| |
set the speed of a DC motor. Values can range from 0 (off) to 100 (full speed).
- Parameters
-
motor | the DC motor to configure |
speed | speed to set the motor to |
void setPWMPeriod |
( |
float |
hz | ) |
|
Sets the PWM period. Note: this applies to all PWM channels.
- Parameters
-
void setStepperDirection |
( |
AdafruitMS1438.STEPMOTORS_T |
motor, |
|
|
AdafruitMS1438.DIRECTION_T |
dir |
|
) |
| |
Sets the direction of a stepper motor, clockwise or counterclockwise
- Parameters
-
motor | Stepper motor to configure |
dir | Direction to set the motor in |
void setStepperSpeed |
( |
AdafruitMS1438.STEPMOTORS_T |
motor, |
|
|
int |
speed |
|
) |
| |
Sets the speed of a stepper in revolutions per minute (RPM)
- Parameters
-
motor | DC motor to configure |
speed | Speed to set the motor to |
void stepConfig |
( |
AdafruitMS1438.STEPMOTORS_T |
motor, |
|
|
long |
stepsPerRev |
|
) |
| |
Sets a stepper motor configuration
- Parameters
-
motor | Stepper motor to configure |
stepsPerRev | Number of steps to complete a full revolution |
void stepperSteps |
( |
AdafruitMS1438.STEPMOTORS_T |
motor, |
|
|
long |
steps |
|
) |
| |
Steps a stepper motor a specified number of steps
- Parameters
-
motor | Stepper motor to step |
steps | Number of steps to move the stepper motor |
The documentation for this class was generated from the following file:
- /var/lib/jenkins/workspace/upm-doc-stable/build-33/src/adafruitms1438/AdafruitMS1438.java