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