sprintf(myConcatenation, "%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f", ax, myStr, ay, myStr, az, myStr,gx, myStr, gy, myStr, gz, myStr, mx, myStr, my, myStr, mz, myStr, yaw, myStr, pitch, myStr, roll); //connecting many variables that I want to display in one string
pCharacteristic->setValue(myConcatenation); //sending to the App
Attempt to get item number 4 of a list of length 3: (989.00 707.00 16276.)
the App then tries to access a value in the list that does not exist
char myConcatenation[80];char myStr[] = ",";
sprintf(myConcatenation, "%3.2f%s%3.2f%s%3.2f", yaw, myStr, pitch, myStr, roll); //connect yaw, pitch, roll into string
953.00,512.00,16491.00
char myConcatenation[3];char myStr[] = ",";
sprintf(myConcatenation, "%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f%s%3.2f\n", ax, myStr, ay, myStr, az, myStr,gx, myStr, gy, myStr, gz, myStr, mx, myStr, my, myStr, mz, myStr, yaw, myStr, pitch, myStr, roll); //connect yaw, pitch, roll into string
871.00,618.00,16491.00,-7.00,5.00,4.00,-144.00,2.00,162.00,109.42,4.22,4.62
Ah, ABG has shown you how to append the file as I described.
I think it may not matter that the raw list is appended to the file,
Hello Chris, Thank you for your responses :) Yes my hair is getting a little bit grayish, uff ... :D but I will solve it eventually! The file is getting appended, but I am getting it only in one column. And the weird thing that I am little bit scared of is that even if I am trying to change the size of for loop, I am getting only 3 values (ax, ay, az) Check the code part. and even if I use NRFconnect (ble app from Nordic Semiconductor) I can't see it there.
SETUP:
My notify input from Arduino IDE (weird is that it won't notify more than 3 values even I put there 9) .
Label print doest work either :/
nrfConnect output:
I will attach my .aia file so you can check it out.
I would be very glad if you would try to help me solve this or give some info on my troubleshooting process.
Thank you,
Boris
If there's no such a function to change MTU in AppInventor I will probably have to code, right? (let's slice the melon then).
pCharacteristic->setValue();
//Data Packets to App
Data were saving into the file only in one column so I changed "\n" for "," and it works well now. But I found a few problems (see pics below):
1) If I connect to the ESP32 at a different time, my labels get changed (ax doesn't display in axLabel and so on...) This occurs only with labels ((see pics below), appending to file is OK. Maybe it has something to do with timings, I am not sure. (I tried to lower the delay from 800 to 200).
2) Is there any chance to make it faster?
3) And these brackets... I am thinking I will use the bracketErase Procedure I used before
EDIT:
char strOut[16];
sprintf(strOut,"%3.2f",ax);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(10);
sprintf(strOut,"%3.2f",ay);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(10);
sprintf(strOut,"%3.2f",az);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(10);
sprintf(strOut,"%3.2f",gx);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(10);
sprintf(strOut,"%3.2f",gy);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(10);
sprintf(strOut,"%3.2f",gz);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(10);
sprintf(strOut,"%3.2f",mx);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(10);
sprintf(strOut,"%3.2f",my);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(10);
sprintf(strOut,"%3.2f",mz);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(10);
sprintf(strOut,"%3.2f",yaw);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(10);
sprintf(strOut,"%3.2f",pitch);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(10);
sprintf(strOut,"%3.2f",roll);
pCharacteristic->setValue(strOut);
pCharacteristic->notify();
delay(50);
16336 is on Ax now
You can see a change there (16334 is on Gy now)