Pages: [1]   Go Down
Author Topic: DFRobot Rover: Drive without USB cable?  (Read 1475 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello!

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?

I tried the following example found in http://www.robotshop.com/content/PDF/dfrobotshop-rover-user-guide.pdf (however the motors first starts after connecting USB):

Code:
/* 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);
}
Logged

Netherlands
Offline Offline
God Member
*****
Karma: 5
Posts: 615
A naughty mind is a joy forever.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure since I have no rover to test.

By looking at the schematics, http://www.robotshop.com/content/PDF/dfrobotshop-rover-schematic.pdf, the rover apparently has a switch called S1.
It switches off all power, except... when connected to USB.
Set wrong it might explain the problem.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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??
NONONONO
YESNONONO
NOYESNONO
YESYESNONO
NONOYESNO
YESNOYESNO
NOYESYESNO But i want this smiley-sad
YESYESYESYES - 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
« Last Edit: August 11, 2011, 04:52:53 am by Schludi » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey if found it out - one battery was low smiley-lol.... WTF.... smiley-sad . Thx

Funny: Now it's driving in the other direction smiley-lol
Logged

Pages: [1]   Go Up
Jump to: