Hi!
I have tried the DCMotorDriverTest for Arduino:
#include “MeOrion.h”
MeDCMotor motor1(PORT_1);
MeDCMotor motor2(PORT_2);
MeDCMotor motor3(M1);
MeDCMotor motor4(M2);
uint8_t motorSpeed = 100;
void setup()
{
}
void loop()
{
motor1.run(motorSpeed); /* value: between -255 and 255. /
motor2.run(motorSpeed); / value: between -255 and 255. */
motor3.run(motorSpeed);
motor4.run(motorSpeed);
delay(2000);
motor1.stop();
motor2.stop();
motor3.stop();
motor4.stop();
delay(100);
motor1.run(-motorSpeed);
motor2.run(-motorSpeed);
motor3.run(-motorSpeed);
motor4.run(-motorSpeed);
delay(2000);
motor1.stop();
motor2.stop();
motor3.stop();
motor4.stop();
delay(2000);
}
But when I upload the code to the mbot the mbot don’t go straight on but will turn turn left and turn to right.
I have changed the code to:
#include “MeOrion.h”
MeDCMotor motor1(PORT_1);
MeDCMotor motor2(PORT_2);
MeDCMotor motor3(M1);
MeDCMotor motor4(M2);
uint8_t motorSpeed = 100;
void setup()
{
}
void loop()
{
motor1.run(motorSpeed); /* value: between -255 and 255. /
motor2.run(motorSpeed); / value: between -255 and 255. */
motor3.run(motorSpeed);
motor4.run(-motorSpeed);
delay(2000);
motor1.stop();
motor2.stop();
motor3.stop();
motor4.stop();
delay(100);
motor1.run(-motorSpeed);
motor2.run(-motorSpeed);
motor3.run(-motorSpeed);
motor4.run(motorSpeed);
delay(2000);
motor1.stop();
motor2.stop();
motor3.stop();
motor4.stop();
delay(2000);
}
then the mbot will go straight on.
Also I don’t know why I need motor1 and motor2 because the mbot will work when I use only motor3 and motor4.
Hope somebody can help me.
kindly regards