Hey, on the code println() is at the end of each of my lines that i need to be sent and shown on the application
Made the changes on delimiter for my Bluetooth client
As for everything else I am not sure I understand how to do them exactly, I am not experienced at all with those things
If you could provide me some guidance i would greatly accept it
Here is an updated blocks sample illustrating these ideas ...

The preceding post is for comma delimited long messages.
If you insist on sending single data per line, you would need to assign eight labels, one per named datum, and send the incoming global message through an eight rung if/then/elseif ladder checking if the message should be dropped into which label text
Use the blue mutator control on the if block to add rungs.
Test if message contains 'i1:' for labeli1...
Hey, the situation is like this, i don't really know what to do so i implemented what you gave me, it works the app does not crash anymore and it changes nicely buuut it does it all only one first line, all the messages that are sent are going in the first label...
This is how my blocks look like atm
I am sorry for burdening you but it's been troubling for a while and i don't know how to do it
I also did not know how to get all the blocks you showed there but thanks for the file i managed to make use of the backpack
Dear @Cho0coCheese, the blocks you've posted aren't actually applying what @ABG has suggested.
As he said, if you transmit each data with a println(), each transmission ends with the Linefeed, therefore the split at "\n" will only generate a list with a unique element (the received data) and therefore the block "min" will have always a "1" in the list of items, thus always showing the data in the first label.
What he said is to transmit the whole pattern of data, each one separated by a "," (comma), and ended only once with a \n . In other words you can do:
BT.print(data1);
BT.print(',');
BT.print(data2);
BT.print(',');
........
BT.print(data7);
BT.print(',');
BT.println(data8);
So only after having received the last data, sent by means of a println(), the BTclient will stop receiving, and the split at ',' block will do its job. Otherwise if you transmit each data with a println(), each data will end with a \n and you will have to fill 8 separate labels each one related to a specific data. But, to obtain a correct addressing between data and its label, you'd better add in the transmitted data also its ID (like i1data1, i2data2, ...i8data8) and an if/then/else loop has to be used to perform the correct labels' assignment . (I'd rather suggest you to use the first approach)
Hoping this would help you.
Ok so I really am stuck here, this is how my blocks look like
This is what my app looks like, it only shows the first row which changes the values one by one
This is what I want my app to look like. I am sorry if I am bothering you, but this is the first time I'm trying to make an app, and due to my deadline for tomorrow when I have to present it in a competition I am really starting to panic :')
It does not matter if the text is written only on one label, I only want it to show my values one above the other, like it shows in the screenshot above
(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.
.
Also upload your latest sketch .ino
Testcontinuarea.aia (290.9 KB)
cod ArduinoIDE comentat.txt (11.9 KB)
Here is the code, i don't have the sketch file because one of the colleagues i am going with made it and this version is before he corrected the incorect value shown on A2
So you are sending one line per reading:
//10. Bluetooth Communication
void sendNextBTChannel() {
if (Serial.availableForWrite()) {
// Trimite toate datele indiferent de mod
Serial.println("Tensiuni");
if (abs(averages.a0) >= 1000000) {
Serial.print("A0: ");
Serial.print(averages.a0 / 10000000.0, 4);
Serial.println(" V");
} else if (abs(averages.a0) >= 1000) {
Serial.print("A0: ");
Serial.print(averages.a0 / 10000.0, 4);
Serial.println(" mV");
} else {
Serial.print("A0: ");
Serial.print(averages.a0 / 10.0, 1);
Serial.println(" μV");
}
/* if (abs(averages.a1) >= 1000000) {
Serial.print("A1: ");
Serial.print(averages.a1 / 10000000.0, 4);
Serial.println(" V");
} else if (abs(averages.a1) >= 1000) {
Serial.print("A1: ");
Serial.print(averages.a1 / 10000.0, 4);
Serial.println(" mV");
} else {
Serial.print("A1: ");
Serial.print(averages.a1 / 10.0, 1);
Serial.println(" μV");
}
if (abs(averages.a2) >= 1000000) {
Serial.print("A2: ");
Serial.print(averages.a2 / 10000000.0, 4);
Serial.println(" V");
} else if (abs(averages.a2) >= 1000) {
Serial.print("A2: ");
Serial.print(averages.a2 / 10000.0, 4);
Serial.println(" mV");
} else {
Serial.print("A2: ");
Serial.print(averages.a2 / 10.0, 1);
Serial.println(" μV");
}
if (abs(averages.a3) >= 1000000) {
Serial.print("A3: ");
Serial.print(averages.a3 / 10000000.0, 4);
Serial.println(" V");
} else if (abs(averages.a3) >= 1000) {
Serial.print("A3: ");
Serial.print(averages.a3 / 10000.0, 4);
Serial.println(" mV");
} else {
Serial.print("A3: ");
Serial.print(averages.a3 / 10.0, 1);
Serial.println(" μV");
}
*/ // Curenți
Serial.println("Curenti");
Serial.print("i1: ");
Serial.print(averages.current1, 3);
Serial.println(" mA");
Serial.print("i2: ");
Serial.print(averages.current2, 3);
Serial.println(" mA");
Serial.print("i3: ");
Serial.print(averages.current3, 3);
Serial.println(" mA");
Serial.println(" ");
}
}
Your aia will need to reflect that, if you have no control over the input.
Yes it sends one line per reading
Could you show me how can i make my aia reflect that?
I set up a dictionary mapping message prefixes (part before the ':') to Labels.
Yours were scrambled, so I leave it up to you to unscramble them.
Shame you didn't name them.
Each incoming message is sent to be split at ':' to a modifies procedure:
The incoming split character is a ':', so by splitting the message at ':' item 1 is the part to use as lookup key into the dictionary of Labels.
You probably want an extra Label to catch messages that don't have a ':' or have a key not in the table, for CYA.
Thank you very much
It's midnight, i hope i will be able to get to it in the morning...... I apologize for being slow and having you come back multiple times here....
I have downloaded the example "BlueTooth_delimiter_sample.aia " hoping that it would show me the basics of connecting to a bluetooth device that is send a stream of data and that data be presented on the app screen. All I got was 4 text labels "Text for Labelx"
The first thing I notice is the example doesn't connect to any specif bluetooth device.
What am I missing please? Once I get the connection sorted I can then start to work on using the data
BLE or pre - BLE?
I was trying Classic for now but since then I have found an example that has got me going. I am now getting the feed from the ESP32 and have worked out how to process it. Next thing is to get the feed running continuously rather than have to click a button for each line. The "while" 'true" "do" didn't work for me
Anyway rather than clutter this thread I will drop off and if I get stuck I'll open my own
Thanks for getting back
Poll using a Clock timer
Yes I had seen that people did that and it struck me as some clunky workaround. waiting for a timer event to be able to poll another event. Just use the actual event as the trigger or have a free running "while" loop. But I guess that is one of the quirks of MITAI2 that I'll just have to get used to
Thanks again
read this
to get a better understanding how things are working here
Taifun
Great thanks. Its only day 2 for me and information like this is really essential reading beyond meowing cats. It wasn't immediately obvious where the principles of the MITAI2 were to be found.
Thanks again
(Similarly, I had spent ages struggling with Autodesk Fusion and somebody said "You need to use Rule #1" once I found that the doors opened.)