Arduino Datasheet Fix — Hw 130 Motor Control Shield For
void loop() // Motor M1 forward at half speed digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW); analogWrite(ENA, 128);
All six analog input pins (A0–A5) remain available for use with other sensors. library to test your DC motors? Adafruit Motor Shield hw 130 motor control shield for arduino datasheet
| HW 130 Signal | Arduino Pin | Function | Notes | | :--- | :--- | :--- | :--- | | | Digital Pin 4 | Motor A Direction 1 | | | IN2 | Digital Pin 5 | Motor A Direction 2 | | | IN3 | Digital Pin 6 | Motor B Direction 1 | | | IN4 | Digital Pin 7 | Motor B Direction 2 | | | ENA | Digital Pin 3 | Enable / PWM for Motor A | Hardware PWM capable | | ENB | Digital Pin 11 | Enable / PWM for Motor B | Hardware PWM capable | | +5V | 5V Pin | Logic supply (input or output) | | | GND | GND | Common ground | | | CS A | Analog Pin A0 | Current sense for Motor A (voltage proportional to current) | | | CS B | Analog Pin A1 | Current sense for Motor B | | void loop() // Motor M1 forward at half
Here is a simple sketch to test the shield with two DC motors. This code does not require an external library, though using the standard AFMotor library is common if the shield is compatible (sometimes HW-130 requires custom code as below). This code does not require an external library,
✅ for hobbyist projects with small DC motors (stall current <600mA). ❌ Don’t rely on it for precision control, high current (>1A), or battery-powered robotics where efficiency matters. 📘 Supplement with the official L293D datasheet from TI/ST for thermal and switching characteristics.