Help a newbie with sending variables from arduino

Hi Brum

This is a bar char: |

It's a good choice when seperating values being sent from Ardunio to an App:

val1 | val2 | val3

The \n in this case means "End of Data", so:

val1 | val2 | val3 \n
(It is explained in my sample App Inventor file, so you lose a brownie point :koala: )

In the Sketch, \n is represented in Serial Comms by Serial.println(); (also explained in my sample Sketch, so that's another brownie point lost :koala: :koala: )

I recently got my bluetooth module but the app won't print what I want.

Inside my app it prints this

The companion shows this

(also tried the -1 instead of bytesavailabletorecieve, but won't work either)

I used a voltage divider with 1k ohms from TX of arduino to a 2k ohms which is connected to ground and in de middle i connected my RX pin of my HC05 to give the bluetooth module the 3.3V signal.

I don't understand why it doesn't work correctly my arduino just prints for example 70|10.00|4101.39

Let's see your Arduino Sketch Brum. Attach it here with the extension changed from .ino to .txt

Sketch.txt (2.6 KB)

It looks fine. See how you have set this option "HighByteFirst":
New

didn't have that on, i'll go ahead and test it

Oh, there might still be a problem with uart speed. You have 38400 set in the program. By default, BT modules are set to 9600. If you have not changed the speed of the BT module, set it to 9600 in the program.

i'm trying to use in another sketch the at command at a baudrate of 38400 and that won't even work if you mean that, currently investigating why that is

void setup()
{
Serial.begin(9600);
pinMode(PunchButton, INPUT);
delay(500);
}

i have read that they normaly are at 38400 but that isn't true then? well read is watched youtube excually

The hc-05, hc-06, and xm-15b modules I had set were 9600 by default.

well that worked, thanks a lot!!!

but still don't understand how to change the standard bautrate because it isnt responding to the AT command

Hc05 to enter the at mode you must connect to the power supply while holding down the button on the board. Terminal speed set to 9600 and marked with CR and LF.

the connection is indicated with the 3 sec blinks right? because then AT still doesnt work on a 9600 rate

I don't know how you connect BT to the terminal? You cannot connect the BT module to pins 0 and 1.

so only connect the VCC and GND then?

If you want to use both the terminal and bt on arduino. You need to create a virtual serial port on other pins and connect BT to them.

Do you have any USB <-> UART converter? E.g. cp2102, ch340 or other?

uhm... if you mean to connect the arduino to my computer yeah xD