Connect motor () direction 1 () direction 2 () & PWM () block is a stack block available in actuators extension for all Arduino boards (Uno, Mega and Nano). This block initializes motor and assigns the motor its direction 1, direction 2 and PWM control pins. You cannot use other motor functions until you initialize the motor using this. This function should come at the beginning for the program.
- Motor channel: This assigns a unique identifier for the motor which can be used in other blocks.
- Direction 1 Pin: This assigns the direction 1 pin for a particular motor.
- Direction 2 Pin: This assigns the direction 2 pin for a particular motor.
- PWM Pin: This assigns the PWM pin for a particular motor.
In this example, we are connecting a DC motor to Arduino using L298 motor driver IC.
In this program, we will control the above motor.