This block is a stack block that is available in the actuator extension for all Arduino boards, such as Uno, Mega, and Nano. It is necessary to use this block at the beginning of the program in order to initialize the motor and set its direction 1, direction 2, and PWM control pins. This block is required in order to use other motor functions, as it is the first step in the process.
Input Parameters
- 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.
Circuit Diagram for Arduino Boards
In this example, we are connecting a DC motor to Arduino using an L298 motor driver IC.
Example
In this program, we will control the above motor.