Problem with controlling motors


#1

I just started working with makebot. First program - buzzer - no issues.
Second program, motors, issue. The motors were not running when I used this program
#include <Makeblock.h>
#include <SoftwareSerial.h>
#include <Wire.h>

MeDCMotor motor1(M1);    //130 DC Motor can connect to the motor interface(M1 or M2)
 
uint8_t motorSpeed = 100;   // value: between -255 and 255.
 
void setup()
{
 
}
 
void loop()
{
    motor1.run(motorSpeed);
    delay(2000);
    motor1.stop();
    delay(100);
    motor1.run(-motorSpeed);
    delay(2000);
    motor1.stop();
    delay(100);
}

I checked the connection (it was plugged in correctly) and the motors work when a dc voltage is applied. I noticed on the ports that there is no voltage change at the ports.

What could be wrong?


#2

Hello

Your program seems correct, I have some questions:

  1. Did you connect the external power source?
  2. Make sure your switch is open.
  3. If motor rotate, the leds next to the m1 and m2 ports will light
  4. which board do you use Orion or mCore?

Thanks


#3

To answer your questions - I am using Orion, I had it plugged into my computer via USB port, the switch was on yet the led lights by the motor did not light.


#4

Hello

Power source from your computer won’t drive the motor on M1- M2 or Port 1- 2, the external DC power supply must be used.

Thanks


#5

Did you get the motors working?


#6

I had the same issue. Everything working when plugged in with the USB, but not the motors. I didn’t realise that I needed to press the little power on button near the battery connector as well and the on button on the back of my ranger. Doh!