Troubleshooting proceeding via Support Center.
Hi,
The Arduino software should be the same running on a MAC as on a PC. The PCB does not come with a program installed, so we are not sure how you managed to get it running Fwd / Rev. when you plug the board into your Vista machine, does it detect the COM port and transfer any information (“device installed correctly and ready to use”)? The board should be plug and play - connect the USB plug from the PCB to the computer and it should auto detect the FTDI chip. Once you open the Arduino software, you should see the COM port accesible. Be sure NOT to connect any batteries in order to test it (the board can be powered from the USB plug alone). Verify and upload the Blink LED program (found in examples) and wait until the software says “done”. Get back to us with any progress.
Sincerely,
Hi,
You can modify the basic code found in the manual to do what you want. The basic code (slightly modified) is as follows (anything to the right of two slashes is a comment):
[code]
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); // Sets the baud rate
}
void loop()
{
int leftspeed = 255; //255 is maximum speed
int rightspeed = 255; //255 is maximum speed
// Note that the terms leftspeed and rightspeed are not reserved words
analogWrite (E1,leftspeed); // This sends the signal to set the speed for motor 1
digitalWrite(M1,LOW); // This sends the signal to set the direction of rotation for motor 1
analogWrite (E2,rightspeed); // This sends the signal to set the speed for motor 2
digitalWrite(M2,LOW); // This sends the signal to set the direction of rotation for motor 2
delay(100); // The delay is 100ms, but you can increase this to 1000 which is 1s
}[/code]
The only part which would need to be modified would be the section under “void loop”
Note that E1, E2, M1 represent the motor’s direction. and the values “leftspeed” and “rightspeed” are associated with each motor’s speed. The code above has the motors rotate at full speed.
To stop the motors, use the following code:
digitalWrite(E1,LOW);
digitalWrite(E2,LOW);
This sets the voltage to zero, effectively stopping the motors. To get the rover to turn right or left, set M1 and M2 opposite (one HIGH, the other LOW). Therefore the start of your code should ressemble:
[code]
int E1 = 6;
int E2 = 5;
int M1 = 8;
int M2 = 7;
void setup()
{
int i;
for(i=5;i<=8;i++)
pinMode(i, OUTPUT);
Serial.begin(9600);
}
void loop()
{
int leftspeed = 255;
int rightspeed = 255;
analogWrite (E1,leftspeed);
digitalWrite(M1,LOW);
analogWrite (E2,rightspeed);
digitalWrite(M2,LOW);
delay(1000);
digitalWrite(E1,LOW);
digitalWrite(E2,LOW);
delay(500); // A small pause to allow the motors to stop
analogWrite (E1,leftspeed);
digitalWrite(M1,LOW);
analogWrite (E2,rightspeed);
digitalWrite(M2,HIGH);
delay(1000);
digitalWrite(E1,LOW);
digitalWrite(E2,LOW);
// and so on…
}[/code]
Hi E-Penguin,
My apologies - it seems I overlooked your question. The new bluetooth module (which is likely the one you have) needs to be set to 9600 as you suspected. This is different than the 115200 of the original. Use Xon Xoff and set both switches to ON (default setting). That should work. Get back to us if you have additional questions or comments.
Sincerely,
Hi,
We have contacted the manufacturer and either they will reply here directly or we will pass along the information as soon as we receive it.
Sincerely,
Hi,
The manufacturer indicates the baud rate can be changed via the AT command:
AT+UART=,,
You can get more information from the user guide.
Hope this helps,
Can you reset it to 115200?
Hi E-penguin,
Please contact us via the Support Center (technical department and refer to this thread and provide your order number) and we will see what we can do. Please also indicate if you grant us permission to pass along your e-mail to the manufacturer.
Sincerely,
My robot finally arrived; all looks good but my LiPo charger is also without the JST connectors. No big deal, I can use the AA batteries for the time being, I was just wondering if the RMA involves sending the whole thing back, of if you just mail me the two connectors and I learn to solder? I guess I’m going to have to learn one day…
Hi, I think my DFRobot bluetooth thingy has defaulted to “system defaults” - the pairing code seems to be “1234” and the baud is 9600. This matches what’s in the datasheet (well, one of them…)
Now, I’ve tried putting it into “AT Mode” via the little switch on top, but I get no response to any commands (eg ‘AT\r\n’).
Any suggestions as to how I might change the baud rate? The pairing code I can live with as ‘1234’ so I don’t need to change that.
I’ve tried setting it to various values in the code but only 9600 produces anything via bluetooth - higher settings work when connected through USB so I’m pretty sure it’s not a hyperterminal issue.
The link light stays on once I’ve established an rfcomm connection and switched to AT via the DIP switch so I’m fairly confident that it is receiving the AT strings. No response is seen though (I would expect ‘OK’ for ‘AT’). I suppose a Plan B would involve wiring it into the digital IO pins and using SoftwareSerial talk to it and reprogram it, whilst using the UART/USB for connection to the computer?
There’s no way to set it to a higher speed? 115200 is, as I’m sure you’re well aware, 12 times faster. That makes a significant difference in responsiveness in the robot.
Hi, thanks for the tip.
Unfortunately that seems to have made it give up completely. In AT or Normal mode, now nothing is able to discover the bluetooth module (I’ve tried with 4 different bluetooth adapters across 2 PCs, one Linux and one Windows 7). The STATUS light blinks slowly but the LINK light never comes on.
Even before I tried the AT switch, it wasn’t very good at maintaining a connection (a few minutes at most), something I put down to the baud rate. Now I’m wondering if it isn’t just a bad module.
Loathe as I am to give up and admit defeat, I might request an exchange for the module (and get the missing JST connectors for the LiPo adapter while I’m at it).
Can’t get the blasted thing to do anything at all now - the module is no longer discoverable (in either mode) by my PCs.
The command “at\r\n” in AT should return “ok”, but I never managed to get that far as I can’t even connect now…
I haven’t tried it on the Rover but the code for blinking the LED is pretty widely available. You probably need to change the pin no. in the code. I don’t know if you tried their code to test the motors but it seemed to work for me. It even worked over bluetooth (although I still haven’t got it working with an Android phone–just the PC).
About your charger issue. I think you are having the same experience I had. They seem to being having some issues after a bunch of the parts from the “kit” were discontinued. See my thread below for how I solved it (more or less).
John