ChartMaker extension

Please show your new blocks in BluetoothLE1.StringsReceived

Ok ,you made it :slight_smile:
One blue package had jump out during all the tests (in red) :sweat: my apologize .

it's working !

Yay!! Good news :smiley:

Many thx for all your time on it! :+1:
but is that the method to make it in column (2 columns but 1 row) (as my former version with the simple split wascreating 2rows into 1 column?)

This:

image

makes a list, in csv terms of 3 columns and one row.

1,24,64

If we added another set of data:

[[1,"24.00","63.00"],[2,"25.00","67.00"]]

you would then get, in csv terms

1,24,63\n2,25,67

(the "\n" wouldn't show in a csv file)

1,24,63
2,25,67

ok, I will try to use this then!
thx a lot!

I currently trying to adapt the solution to get some temperature evolution through time. However I m strugglying:
I send a batch of value contained in a table (and let say K is the time) througth the serial (BLE):
image

how I can get this table into ChartMaker?
I know how to do a table by sending the data one peer one and using appends (works great when you send value only every 2 minutes see below)

How about showing some data that comes back?

Hi TIMAI2,
Glad to see you!
well the data are the same as we managed to get it working last time (if you recall) , e.g:
0,25,0 /n
1,25,0 /n
2,26,0 /n
3,26,0 /n
4,25,0 /n
....

(first is the k number index, 25 is the temperature picked in the tempHistory[k] array and 0 is a dummy humidity because i didn't do an array for it yet )

My current foundings are that the app inventor get the data (I can see them popping up on a list), but they will overwrite each other (so my list will only have 1 line), except if I give more time between 2 lines sending ( 1 second)

the idea behind is to send and display the last 24 measurements that will have all the time the same K index (e.g. to look at the temperature evolution during the last 24h for example)
So I need to erase the table each time news data are coming in (unsure how to clear a table yet...)

image

  1. it is "\n" NOT "/n"

my mistake, but it is controled by the Serial.println that do the \n

You will need to do a find and replace on it then...:slight_smile:

maybe I didn't explain it very well, but the Arduino Serial.println is doing a ''return to line '', that do not appears on the app inventor side : the data looks like that really in a list
(0,25,0)
(1,25,0 )
(2,26,0)
(3,26,0)
(4,25,0)

Just run some text manipulation blocks on the data until you get it into the correct format/layout. It could be that the "\n" are there but just not showing. You will need to lose the parantheses though.

Alternatively, convert to an AI2 list ?

yet I currently manage to get something almost working by doing this:

But the global List_T is not cleared aech time I got new data, and on the arduino side I need to wait 1second between each line data sending
for example:
(0,25,0)
... wait 1000ms
(1,26,0)
.. wait 1000ms
.....

this just to give time to app inventor to separate each item of the list and avoid them to override each other.... maybe there is a faster solution for app inventor to get array?

Just run some text manipulation blocks on the data until you get it into the correct format/layout. It could be that the "\n" are there but just not showing. You will need to lose the parantheses though.

Alternatively, convert to an AI2 list ?

I believe the format is correct as the data are displayed, the parantheses appear only in the listView but apparently are not present (??!!)
AI2 list? dodn t know yet, but will have a look at it.

The BLE StringsReceived event is much simpler ...

when BLE StringsReceived
   for each **item** in stringValues
      init local **reading** to split **item** at ';'
         add **reading** to list global **list_T**
      end init local
   end for each
end when BLE StringsReceived

(I assume global list_T is a table, a list of readings, and each reading is the list gotten from a split at ';')

I could code this for you if you

Please download and post each of those event block(s)/procedures here ...
(sample video)

Hi ABG,

Here is the BLE block, (the timer block is just a display, and it is working for now). Note that the global list_T should be cleared each time I got a new batch of values (I didn' t do it in this screenshot - it may complicate the thing as I tried with "set global List_T -> make empty list" after the "is a list? get string values" but without succes yet). by advance thx for your help.

These are the (draggable) blocks for the code I posted in ChartMaker extension

Again, I assume Chartmaker needs global list_T to be a table (list of lists) as input.

Hi, I will have a try and let your know ... I already tried something closeby and it was not working (but was working on another project where I just got a line with 3 values separated by ";")