Me Dual Motor Driver only one direction


#1

Hi. Newbie here.
I’m trying to work out where I’m going wrong. I just purchased a.

  1. Arduino Uno
  2. Makeblock Orion Shield
  3. Makeblock Me Dual Motor Driver
  4. 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?


#2

Nevermind… kinda worked it out. I changed the cables to port 1 and it all started working.
Weird.
Thanks anyway


#3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.