String Spliting Problem in BluetoothLE

Hi,
I have been trying to split a string, received from BluetoothLE, into four individual values to show on the app screen in realtime. The string has the following fomat ["0.57;0.32;4.35;0.44;"]. The prompt from the app is 'List index too large' (REF. IMAGE A & 5a). However, if I input the string ["1.11;2.22;3.33;4.44;"] (REF. IMAGE B & 5b) as a text block by myself, the split block and hence the app are working fine. These are actually four pressure values printed on the arduino nano's serial monitor.
Please guide me how to split a string received from BluetoothLE and show it on the app screen in realtime. Thanks a lot.
My app block, arduino code and reference images are attached.
Ahmed



3
blocks4




TestProject (1).aia (3.0 MB)
TestProject.ino (9.0 KB)

Note that in the stringsReceived event the stringValues value is a LIST.
Assigning a list into a text field adds those pesky [" " ] wrappers.

It's neater to just select item 1 from list stringValues and feed that to the SPLIT AT ; block.

Also, it is safer to check if length of list >= 4 before selecting items from the output of the split.

Look before you leap.

2 Likes

Thanks a lot Sir! I have been trying to understand and resolve this issue for two weeks. Your valuable suggestions resolved my problem. I really appreciate you and the forum. Hats off!

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