All,
I have an Arduino Uno and a Bluetooth module hooked together like this: http://www.wateb.com/arduino-uno-bluetooth-mate-gold/
I am able to pair the bluetooth module with my Mac with no issues. I loaded this code on the arduino:
#include <SoftwareSerial.h>
int bluetoothTx = 2;
int bluetoothRx = 3;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void setup()
{
//Setup usb serial connection to computer
Serial.begin(9600);
//Setup Bluetooth serial connection to android
bluetooth.begin(115200);
bluetooth.print("$$");
delay(100);
bluetooth.println("U,9600,N");
bluetooth.begin(9600);
}
void loop()
{
//Read from bluetooth and write to usb serial
if(bluetooth.available())
{
char toSend = (char)bluetooth.read();
Serial.print(toSend);
}
//Read from usb serial to bluetooth
if(Serial.available())
{
char toSend = (char)Serial.read();
bluetooth.print(toSend);
}
}
When using this code, I am able to type strings in on the serial console and they are transmitted to the bluetooth console. However, when I type strings in to the bluetooth console, they are NOT transmitted to the serial console.
I am using CoolTerm for Mac. I've also tried Putty on the PC with no luck. My bluetooth connection settings are:
Baudrate:115200
Data bits: 8
Parity: none
Stop bits: 1
Flow control: off
DTR: on
RTS: on
Again, I am able to transmit from serial -> bluetooth with no issues, but bluetooth->serial is not working at all
Does anyone have any advice on how to fix this? I'm quite new to Arduino, but definitely not a novice in programming.
Thanks!
Kevin