Hw 130 Motor Control Shield For Arduino Datasheet

void loop() motorA(200, true); // forward 78% speed motorB(150, false); // reverse 59% speed delay(2000); stopMotors(); delay(1000); motorA(100, false); motorB(200, true); delay(2000); stopMotors(); delay(1000);

A small 3-pin jumper near the servo headers decides what voltage feeds your servos. Hw 130 Motor Control Shield For Arduino Datasheet

// Right Motor (Motor A) if (rightSpeed > 0) digitalWrite(MOTOR_A_DIR, HIGH); analogWrite(MOTOR_A_PWM, constrain(rightSpeed, 0, 255)); else digitalWrite(MOTOR_A_DIR, LOW); analogWrite(MOTOR_A_PWM, constrain(-rightSpeed, 0, 255)); void loop() motorA(200, true); // forward 78% speed

Upload this code, open the Serial Monitor (or a Bluetooth terminal app on Android), and send F , B , L , R , S . An Arduino Uno or Nano simply cannot provide

When building your first Arduino robot or automation project, one of the first hurdles you encounter is the inability to control powerful motors directly from the microcontroller pins. An Arduino Uno or Nano simply cannot provide the current or voltage required to drive DC motors, stepper motors, or servo motors without risking damage to the board. This is where the comes into play.

void setup() myStepper.setSpeed(10); // 10 RPM