Sending realtime data EMG to my Android via BluetoothLE

That is interesting because this Block never updates the values - populate the Label first, then update the graph, then clear the Label (should not need to clear the Label but hey).

If that works, you could try using the stringValues directly in UpdateGraph..... if it fails, show us the exact content of the Label.

GetStringValues

You don't need to use a Clock in the App because the sending of data is already timed in the Sketch and the BLE blocks deliver the data accordingly. So omit the Clock but observe how the graph should be updated with the values.

image
That's the error sir, same error

Where do those '()' come from?

...we need to see the contents of the Label Muhammad -

For example, is it [(556,543)] or (556,543) or 556,543 ?

Edit: or something else - there seems to be a leading comma there


The content is like that sir, under the graph column

OK, not brilliant - it seems the BLE extension adds those parentheses.

CleanupValue

or:

Given that stringValues is a list as returned from the BLE block,
consider a

  • CSV Row From List or
  • JOIN WITH SEPARATOR ','
    conversion block to turn it into parentheses-free text.

Be aware that AI2 has native charts and graph components, that should not require extensions.

These blocks will deal with the ( ) problem by using a list block to extract your content from stringValues.

It will also settle a difference of opinion among Power Users as to where those ( ) came from.

1 Like

image
Maybe come from this sir?

Well, I just know it sir. And I don't understand about that extension is that added automatically or something?

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?