Bluetooth communication with Arduino

Hi everyone.
This is my first forum post. I am working on a project that involves sending sensor data from Arduino to the App Inventor via a Bluetooth Mate Silver module.
Using the Bluetooth Client palette I correctly acquire the sensor data sent at 1 Hz, without too many errors. Unfortunately raising the frequency I have problems of synchronization between Arduino (10 Hz) and the clock of the app and I have many coding errors of the sent string.
Can anyone help me solve this problem?
I attach an image of the part of the project that deals with reading the data via bluetooth.
Thank you all!!

Cattura|690x199

Hi LeaLuc

Issues:.

  1. You must ensure that the App Timer Interval is faster (15 to 20%) than the Arduino time interval (controlled in the Sketch Loop). Determine the slowest process speed acceptable for the project. The slower the better.

  2. Work with Strings (text) Data

  3. App Clock Timer Block:
    BtReceiveData
    (Note, control the timer settings in the Blocks. The timer should not be switched on until a connection is made.)

  4. The App and the Sketch need to agree on the End-of-Data Flag:
    InitScreen

That’s the most I can offer without seeing the Sketch.

2 Likes

Hi ChrisWard
thanks for your directions! They were truly precious!
Currently everything seems to be working properly.
Can I ask you why it was necessary to enter “-1” as the number of bytes?

I thank you so much!

It’s just a simple way to force the function to collect all bytes sent.

1 Like

Read the tooltip for the BlueTooth ReceiveText block.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.