void setMotor(int speed, bool reverse) digitalWrite(M1_DIR, reverse ? HIGH : LOW); analogWrite(M1_PWM, constrain(speed, 0, 255));

Unlike its more powerful successor (e.g., L298N-based shields), the HW-130 focuses on low-voltage, low-current applications where simplicity and direct Arduino pin mapping are paramount.

#include <AFMotor.h> AF_DCMotor motor1(1); // M1 AF_DCMotor motor2(3); // M3

Hw 130 Motor Control Shield For Arduino Datasheet -

void setMotor(int speed, bool reverse) digitalWrite(M1_DIR, reverse ? HIGH : LOW); analogWrite(M1_PWM, constrain(speed, 0, 255));

Unlike its more powerful successor (e.g., L298N-based shields), the HW-130 focuses on low-voltage, low-current applications where simplicity and direct Arduino pin mapping are paramount. hw 130 motor control shield for arduino datasheet

#include <AFMotor.h> AF_DCMotor motor1(1); // M1 AF_DCMotor motor2(3); // M3 void setMotor(int speed