AdafruitMS1438 Class
- ID: adafruitms1438
- Name: Module for the Adafruit Motor Shield 1438
- Category: motor
- Manufacturer: adafruit
- Link: http://www.adafruit.com/products/1438
- Connection: i2c
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
Item Index
Methods
Methods
AdafruitMS1438
-
bus
-
address
AdafruitMS1438 constructor
Parameters:
-
bus
NumberI2C bus to use
-
address
NumberAddress for this sensor
Returns:
getMillis
-
motor
Returns the number of milliseconds elapsed since initClock(...) was last called.
Parameters:
-
motor
STEPMOTORS_Tundefined
Returns:
Elapsed milliseconds
initClock
-
motor
Resets the clock
Parameters:
-
motor
STEPMOTORS_Tundefined
setPWMPeriod
-
hz
Sets the PWM period. Note: this applies to all PWM channels.
Parameters:
-
hz
NumberSets the PWM period
enableMotor
-
motor
Enables PWM output for a motor
Parameters:
-
motor
DCMOTORS_TDC motor to enable
disableMotor
-
motor
Disables PWM output for a motor
Parameters:
-
motor
DCMOTORS_TDC motor to disable
enableStepper
-
motor
Enables output for a stepper motor
Parameters:
-
motor
STEPMOTORS_TStepper motor to enable
disableStepper
-
motor
Disable output for a stepper motor
Parameters:
-
motor
STEPMOTORS_TStepper motor to disable
setMotorSpeed
-
motor
-
speed
set the speed of a DC motor. Values can range from 0 (off) to 100 (full speed).
Parameters:
-
motor
DCMOTORS_Tthe DC motor to configure
-
speed
Numberspeed to set the motor to
setStepperSpeed
-
motor
-
speed
Sets the speed of a stepper in revolutions per minute (RPM)
Parameters:
-
motor
STEPMOTORS_TDC motor to configure
-
speed
NumberSpeed to set the motor to
setMotorDirection
-
motor
-
dir
Sets the direction of a DC motor, clockwise or counterclockwise
Parameters:
-
motor
DCMOTORS_TDC motor to configure
-
dir
DIRECTION_TDirection to set the motor in
setStepperDirection
-
motor
-
dir
Sets the direction of a stepper motor, clockwise or counterclockwise
Parameters:
-
motor
STEPMOTORS_TStepper motor to configure
-
dir
DIRECTION_TDirection to set the motor in
stepConfig
-
motor
-
stepsPerRev
Sets a stepper motor configuration
Parameters:
-
motor
STEPMOTORS_TStepper motor to configure
-
stepsPerRev
NumberNumber of steps to complete a full revolution
stepperSteps
-
motor
-
steps
Steps a stepper motor a specified number of steps
Parameters:
-
motor
STEPMOTORS_TStepper motor to step
-
steps
NumberNumber of steps to move the stepper motor