Pages: [1]   Go Down
Author Topic: Arduino Uno + Bluetooth Mate - Can't transmit from Bluetooth  (Read 492 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

Code:
#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 smiley-sad

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
Logged

Offline Offline
Sr. Member
****
Karma: 9
Posts: 254
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As a quick check you can connect the rx and tx pins on the Bluetooth mate together, connect it in cool term and send a few characters. That will just confirm that it is sending and receiving properly. Apart from that, I can't see anything obviously wrong with your code
Logged

Pages: [1]   Go Up
Jump to: