Hw 130 Motor Control Shield For Arduino Datasheet Direct
The shield can simultaneously control several combinations of motors: DC Motors: 4 bi-directional DC motors with individual 8-bit speed selection. Stepper Motors: 2 stepper motors
// Define your motor. (1) refers to M1 port. (2) is M2, etc. AF_DCMotor motor(1); hw 130 motor control shield for arduino datasheet
AF_DCMotor motor1(1); // M1 terminals AF_DCMotor motor2(2); // M2 terminals (2) is M2, etc
void setup() pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT); pinMode(ENA, OUTPUT); | IN1 (Pin 4) | IN2 (Pin 5)
Have you fried an Arduino with one of these? (I have.) Tell your horror story in the comments below.
| IN1 (Pin 4) | IN2 (Pin 5) | ENA (Pin 3) | Motor A State | | :--- | :--- | :--- | :--- | | LOW | LOW | HIGH | Brake (stop fast) | | HIGH | LOW | HIGH | Forward | | LOW | HIGH | HIGH | Reverse | | HIGH | HIGH | HIGH | Brake (stop fast) | | X | X | LOW | Coast (free spin) |
The shield uses digital pins for direction and PWM (speed) control.