I recently read the documentation of the ArduinoBLE.h library. Under "Service design patterns" it is noted that it is possible to write multiple values to one characteristic:
How can I achieve that? Unfortunately I cannot find any information about this in the documentation.
I want to send all accelerometer data in one characteristic and all gyroscope data respectively along with a time stamp. This results in two characteristics
- accChara: [time stamp, xAcc, yAcc, zAcc] and
- gyroChara: [time stamp, xGyro, yGyro, zGyro],
where time stamp is an unsigned long (via millis()) and the values read are floats (note: I am using the Arduino_LSM9DS1.h library for the IMU).
The documentation states (as posted in your image):
They just created a comma separated string containing all their data ("200,133,150") and transmitted it using writeValue. You could do the same for your values and convert them back to numbers on your receiving end. Another way would be to use a struct to hold and send your data.