Signal received on MiT APP Inventor not showing the first digit

29 views
Skip to first unread message

Lâm Quang

unread,
May 7, 2019, 3:56:53 AM5/7/19
to MIT App Inventor Forum

Screenshot (7).png

Screenshot (6).png

Hello. Can anybody help me with this. I am connecting Pulse Sensor with Bluetooth Hc05 to display on MIT Inventor App. But the problem is the heart rate number display is sometimes missing the first digit. For example, the heart rate is 104 but it sometimes show 04..

Riccardo Risi

unread,
May 7, 2019, 4:04:55 AM5/7/19
to MIT App Inventor Forum
It's better if you show your block code downloading it with "Download block as image" functionality.
Bye
A.PNG

Lâm Quang

unread,
May 7, 2019, 4:09:46 AM5/7/19
to MIT App Inventor Forum
Thanks you very much, Sir
Screenshot (6).png
Screenshot (7).png

ABG

unread,
May 7, 2019, 10:29:43 AM5/7/19
to MIT App Inventor Forum
You are using the Clock Timer to chop off pieces of the incoming data stream
blindly.

There is a way to insure you get only complete messages, using message Delimiters ...

Use println() to separate messages when you transmit.
Set Delimiter = 10 in BlueTooth Designer.
Check for Bytes Available > 0 in blocks,
but then request -1 bytes to get only full  messages.

ABG

Message has been deleted

Lâm Quang

unread,
May 7, 2019, 11:21:07 AM5/7/19
to MIT App Inventor Forum
I have done it. Thanks you very muchhh. Can you please explain it for me, Sir? I still cant understand why it work

ABG

unread,
May 7, 2019, 1:24:07 PM5/7/19
to MIT App Inventor Forum
I have done it. Thanks you very muchhh. Can you please explain it for me, Sir? I still cant understand why it work


The link has many articles that explain it.

There are more articles on BlueTooth in the FAQ at

The HC05 delivers bytes one after another like
a supermarket checkout counter conveyor belt.

If the customer behind you at the checkout counter 
 is in a rush and rude, they
might start loading their groceries onto the belt before
you have finished loading yours onto the belt.
That would cause the checkout clerk to mix up the orders.
It takes extra effort to block such people when loading the belt.


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


ABG 
Reply all
Reply to author
Forward
0 new messages