I have bought the blank DFRobot Rover to introduce myself to robotics and arduino.
My problem is that i cannot power the motors without USB connection although 4 full AA Batteries are inserted. The D2 LED and L LED blinks, it seems to me the board is waiting for input instead just to power both motors trying the "full speed code".
Is there a way to let the bare DFRobot rover power the motors without USB or other shields?
/* Copy and paste the code below into the Arduino software */
int E1 = 6; //M1 Speed Control
int E2 = 5; //M2 Speed Control
int M1 = 8; //M1 Direction Control
int M2 = 7; //M2 Direction Control
void setup()
{
int i;
for(i=5;i<=8;i++)
pinMode(i, OUTPUT);
Serial.begin(9600);
}
void loop()
{
int leftspeed = 255; //255 is maximum speed
int rightspeed = 255;
analogWrite (E1,255);
digitalWrite(M1,HIGH);
analogWrite (E2,255);
digitalWrite(M2,HIGH);
delay(100);
}
Thank you for your answer. My goal is to run the code without the USB connected to the rover.
The S1-Switch i already noticed. I have 4x 1.5VAA Batteries in the rover. When i disconnect the usb connections, the motors aren't driving using the code above. (L LED near to PWR,RX,TX blinks 1 time the second and there is a tick sound).
When i take out the batteries, the rover isn't moving (no motor drive only from usb power). When the S1 switch is off, the board has power when there is a USB connection.
But having only the code flashed on it without USB Connection, it seems the rover is waiting for input although i don't need input that it only moves forwards when i switch it on. When i connect the USB, the batteries are in and S1 Switch is on, the robot moves.
How can i run the code without the USB connected in the Rover?
USB Connected?
Batteries IN?
S1 Switch enabled?
Basic Code for max. speed works??
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
NO
YES
NO
YES
NO
YES
NO
NO
YES
YES
NO But i want this
YES
YES
YES
YES - I even can send commands via USB/COM
The LEDs on the board are on, when S1 is switched on or the USB connection is in