Hi all,
This is my first bluetooth project. I’m having issues sending and receiving serial data.
I connected the bluetooth mate with an external 5V power supply to Vcc, Gnd to Gnd, CTS to RTS, RX (Bluetooth) to TX (Arduino), TX(Bluetooth) to RX (Arduino). I was able to pair the device with my computer. I set up a virtual COM port for the bluetooth. Then disconnected the RX and TX pins and uploaded the following code to the Arduino:
/***********************
Bluetooth test program
***********************/
int counter = 0;
int incomingByte;
void setup() {
Serial.begin(115200);
}
void loop() {
// see if there's incoming serial data:
if (Serial.available() > 0) {
// read the oldest byte in the serial buffer:
incomingByte = Serial.read();
// if it's a capital R, reset the counter
if (incomingByte == 'R') {
Serial.println("RESET");
counter=0;
}
}
Serial.println(counter);
counter++;
delay(250);
}
I opened up Putty to test it. I have putty set to COM4 (my bluetooth com port) at a baudrate of 115200. I am able to enter command mode and check/adjust the baudrate. However, once I reconnect the RX and TX pins to check the arduino code I get a long line of gibberish. Mostly y’s with two dots over the top. I feel like this is a baudrate issue. However, both the arduino and putty are set at 115200. Has anyone encountered/solved/know how to solve this issue?
Cheers,
SE