Hi. Newbie here.
I’m trying to work out where I’m going wrong. I just purchased a.
- Arduino Uno
- Makeblock Orion Shield
- Makeblock Me Dual Motor Driver
- Makeblock Gripper hand
I’m trying to run some code to open and close the gripper hand.
I find my code can only drive the gripper motor in one direction. Using a negative value doesn’t reverse it.
My code is fairly simple for testing purposes.
#include <MeOrion.h>
#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>
MeDCMotor motor2(PORT_2);
void setup() {
// put your setup code here, to run once:
}
void loop() {
motor2.run(100);
}
Which does drive the motor in one direction. But changing the void loop to ‘motor2.run(-100)’ or any other negative value doesn’t do anything. There is no movement.
If I unscrew the wires from the orange plug in the Dual Motor Driver and switch them around, the positive value in motor2.run does indeed run the motor the other way… but the negative value won’t reserve the direction.
Help?