Example Code for Analog Mode Control

Last revision 2026/01/27

0~2.5V input stands for clockwise rotation, and 2.5~5V input stands for counter-clockwise rotation, while 2.5V stands for stop.

Wiring Diagram

DRI0014_connection_3new

Other Preparation Work

make sure the toggle switches on the driver are in the right position for Analog Mode;

Sample Code

int Motor_pin = 9;
void setup()
{
pinMode(9, OUTPUT);
}
void loop()
{
int value;
  for(value = 0 ; value <= 255; value+=5)
  {
    analogWrite(Motor_pin, value);   //PWM Speed Control
    delay(100);
  }
}

Was this article helpful?

TOP