Once you upload the code, the motor should start spinning.
delay(1000);
The shield stacks directly on an , Mega 2560 (partial pin usage), or Nano (with careful alignment). Below is the critical mapping: hw 130 motor control shield for arduino datasheet better
: Supports up to 4 bi-directional DC motors or 2 stepper motors (unipolar/bipolar).
void loop() if (BT.available()) command = BT.read(); switch (command) case 'F': // Forward motor1.run(FORWARD); motor2.run(FORWARD); break; case 'B': // Backward motor1.run(BACKWARD); motor2.run(BACKWARD); break; case 'L': // Left motor1.run(BACKWARD); motor2.run(FORWARD); break; case 'R': // Right motor1.run(FORWARD); motor2.run(BACKWARD); break; case 'S': // Stop motor1.run(RELEASE); motor2.run(RELEASE); break; Once you upload the code, the motor should start spinning
Supports external power for motors to prevent Arduino damage.
AF_DCMotor motor1(1); AF_DCMotor motor2(2); SoftwareSerial BT(10, 11); // RX, TX char command; void loop() if (BT
The most critical part of using the HW-130 is the . Jumper On: The Arduino and motors share power. Warning: Do not do this if your motors Jumper Off: This is the safest method.
The shield can drive a bipolar stepper motor, making it suitable for projects like a small CNC plotter.
Thermal and power management
本站内容均从互联网收集而来,仅供交流学习使用,版权归原创者所有如有侵犯了您的权益,尽请通知我们,本站将及时删除侵权内容。
Copyright @ 2023 风马牛成人影院 版权所有