Fire_Alarm_System using HC-05 and arduino

hello, I am making a system that send a notification or status (FIRE detected!!!) on the app when the fire sensor detect a fire but my app still doesnt display the output. I hope you can help me.


Where's the part where your sketch sends data to Serial?

Flame = digitalRead(11);
if (Flame == 0)
{
Serial.print("F");
delay(50);
digitalWrite(12, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, LOW);

}
else
{
Serial.print("N");
delay(50);
digitalWrite(12, LOW);
digitalWrite(5, LOW);
digitalWrite(6, HIGH);

can you help me fix this :face_holding_back_tears:

Be sure to use println() at the end of each message to send from the sending device, to signal end of message.

Only use print() in the middle of a message.

Be sure not to println() in the middle of a message, or you will break it into two short messages and mess up the item count after you split the message in AI2.

Do not rely on timing for this, which is unreliable.

In the AI2 Designer, set the Delimiter attribute of the BlueTooth Client component to 10 to recognize the End of Line character.
BlueToothClient1_Properties
Also, return data is not immediately available after sending a request,
you have to start a Clock Timer repeating and watch for its arrival in the Clock Timer event. The repeat rate of the Clock Timer should be faster than the transmission rate in the sending device, to not flood the AI2 buffers.

In your Clock Timer, you should check

  Is the BlueTooth Client still Connected?
  Is Bytes Available > 0?
     IF Bytes Available > 0 THEN
       set message var  to BT.ReceiveText(-1) 

This takes advantage of a special case in the ReceiveText block:

ReceiveText(numberOfBytes)
Receive text from the connected Bluetooth device. If numberOfBytes is less than 0, read until a delimiter byte value is received.

Also, after you have received your message into a global variable, you should test the global variable if it equals 'F' or if it equals 'N', and announce the results accordingly.