PCA9685 DC Motor
Control power and direction of a DC motor
Simulink Support Package for Arduino Hardware / Common
The PCA9685 DC Motor block controls the power and direction of a DC motor connected to PCA9685 PWM chip-based shields such as Adafruit Motor Shield V2. The input signal determines the power supplied to the motor and the direction of rotation of the motor.
The PCA9685 DC Motor block supports all Arduino boards.
Port_1 — Input signal
The sign of the input signal determines the direction of rotation of the DC motor. A positive sign indicates a forward rotation, whereas a negative sign indicates a reverse rotation. The amplitude determines the power supplied to the motor.
100: Forward rotation, minimum to maximum power.
–100: Reverse rotation, minimum to maximum power.
0: No power is supplied.
Any out-of-range values, at the block input port has the same effect as the maximum or minimum input values.
PCA9685 address — Address on PCA9685 PWM chip-based shields
Enter the PCA9685 address on the PCA9685 PWM chip-based shield that is connected to the DC motor.
PWM frequency (Hz) — PWM frequency for DC motor
Specify the frequency (in hertz) on the PCA9685 PWM chip-based shield that is connected to the DC motor for generating the pulse-width modulated signal.
Motor Channel — Motor channel for DC motor
1 (default) |
Specify the motor channel on the PCA9685 PWM chip-based shield that is connected to the DC motor.
Do not assign the same channel number to more than one DC Motor block within the same model.
Introduced in R2023a