Sending realtime data EMG to my Android via BluetoothLE

No, ABG is correct - 'stringValues' is defined as an App Inventor List. We are not using it as a List.

It is because a List of values is expected and thus, if possible, should be processed as such. However, the Arduino is not delivering a List (two or more values sent one after the other), it is sending a concatenated String of two values to suit the graph extension, and therefore in this case 'select list item' might not work. However, you can try it, it works here if I make a test List of one, but my test is not using the value as received via BLE.

If 'select list item', does not work, we have to clean-up the String by removing the brackets, but it should work as per ABG's example.

'Select list item'?.......is that like list picker in app?

Ah, I see. So what should I do sir?

It's a Blocks List

Snap1

.... use ABG's code

1 Like

Excuse me sir, how about I change block set label1 to update graph?

How about this sir, if for example I want to display a graph and use this block


Then I also want to connect BluetoothLE with this block

Will there be errors or crashes with the program from those blocks?

That was just a minimal test to see if data could be extracted cleanly (without ()) from the BLE data stream.

Did you actually try those blocks, using a Label of your choice?

Did you see data arrive in the Label?

Did it look like the data you sent?

If all those are true, my work here is done.

Questions about setting up BLE connections I leave to BLE experts.
Be aware you took a non-BLE Bluetooth sample and converted it into a BLE app.

Questions about how to feed data into a graph extension, I leave to you and the author of that graph extension.

If you want to use the native AI2 graph component, see

image
I have change it sir, and the result is the data extracted cleanly without ()


EDIT : I'm sorry if I just replied, because there is only one Arduino and my friend is still using it to retrieve EMG data so I take turns using it

The 'Strings Received' Block should be as per ABG's example.

The Button_Connect Block should be fine - but do you use a Clock Timer to allow the Scan to find all available devices?

:joy: I didn't see your last post when I commented on the previous one - so that is good news about the clean values, but what about the graph?

Have you tried the "look over there!" approach? Tell your friend to "look over there" and quickly grab the Arduino while he/she is distracted. :innocent:

Ensure you reserve time to make your App GUI look professional. Use image buttons - well defined images can be understood by anyone of any language and also they usually take less space than a text button.

yes sir I have used it

That's the question sir, I have tried but always many error :disappointed_relieved:

I will do it sir, then I will send it to this forum when it's finished

Juan has written a guide on how to use App Inventors built-in graphs function:

@Muhammad_Zulkifli

Don't draw, just present the data in a Label
234,765

Have you got this?


Like this sir? The data is in the label below the graph it write 791,762
I send data from Arduino using a Variable Resistor