Read Data from Arduino via HC-05 Bluetooth Module

Hi Good Day! I really need help, I can't quite figure out why this thing is not working, this app is from " Bluetooth HC-06. Arduino. Send. Receive. Send text file. Multitouch. Image - #5 by Juan_Antonio " entitled: 5.- App requests temperature and humidity to the Arduino. The Arduino sends values. I followed everything, I set the set the DelimiterByte value 10, set the arduino UNO code baudrate to 9600, then tried 115200, still the app doesn't work. When connecting to HC-05 Bluetooth module it works but on the Check Temperature button when I click it - it just freeze, as shown in the picture below.

This was the app code:
Screenshot (686)

And this is the arduino UNO Code:

char caracter;

void setup() {

  Serial.begin(9600);

}

void loop(){

int humedad = 10;

int temperatura = 11;

delay(300) ;

// Bluetooth

if(Serial.available()) {

  caracter = Serial.read();

    if(caracter == 'T')

    {

        int temper = temperatura;

        Serial.print(temper);

        Serial.print("\n"); // Fin de línea. Importante.

     

    }

    if(caracter == 'H')

    {

        int humed = humedad;

        Serial.print(humed);

        Serial.print("\n"); // Fin de línea. Importante.

    }

        caracter == ' ';

    }

}

Here is sample code to receive both:

Here is an updated blocks sample illustrating these ideas ...

BlueTooth_delimiter_sample.aia (3.4 KB) global message

1 Like

Hi, thank you it's now working!

Hey I don't quite understand this part, any help? thanks

This is a general purpose procedure to assign the parts of a message into separate Label.Text fields, for people who send multiple text values per message.

It needs a list of target label components.

I use the min function to deal with mismatched list length

1 Like

ok, thanks a lot for reply! God bless