Bluetooth with Nano and App Inventor.

Hello.
I am trying to send the string “Hello World” from the ardunio to an android tablet using App Inventor to make the receiving app.
Currently the connection is made and everything is mostly working.

The part im getting stuck on is actually receiving the string on the tablet. Rather than getting ascii characters i either get <?> (black diamond with a question mark) or numbers 240 - 253.
However in each case im getting the same number of characters/numbers an the message i am sending So i know the message is being sent correctly (or at least with the same number of characters.)

Im trying to figure out the correct communication method,

on App Inventor I am using label.Text = BluetoothClient1.recieveText(BluetoothClient1.bytesAvailbleToRecieve) –http://prntscr.com/bomjvz

On Arduino i am using

  result = "Hello World";
  for (int i = 0; i < result.length(); i++){
  BTSerial.write(int(result[i]));
  Serial.write(int(result[i]));
  }
  Serial.println();

On the usb serial i am getting “Hello World”
(note: i have tried using int, byte and char)
I have defined the software serial for pins 8 and 9 and they are connected correctly)

Is the baud rate the same?
We ask to post all your code because if you are asking a question 99% of the time people don't know enough to pick out the faulty bit of the code.

How is result declared?

I am trying to send the string "Hello World" from the ardunio to an android tablet

You don't say what you have done, or where you are going, but, on the thin bit of code shown, I wonder if

BTSerial.println("Hello World");

might give the result you want. It's just a guess, but you might try sending it to a standard bluetooth terminal app. If it works, you know it isn't a bluetooth problem, you know it isn't an Arduino problem, and it is likely to be an App Inventor problem.

Sorry for late response.
For some reason the baud rate wasnt correct, (although the default should be 9600 according to the data sheet)
was a simple fix with AT+BAUD4 command being sent at the start then flushing the port, however does make the first message via bluetooth AT+BAUD4 but i can filter that out :slight_smile:

AceScottie:
AT+BAUD4 command being sent at the start then flushing the port, however does make the first message via bluetooth AT+BAUD4 but i can filter that out :slight_smile:

It sounds like you are including the configuartion command in your communications code. Use one programme to configure, and another to communicate.