Closed mristau closed 6 years ago
Hi @mristau,
I would suggest using BLECharacteristic
with a value size of 3 bytes: https://github.com/sandeepmistry/arduino-BLEPeripheral/blob/master/API.md#contructor
Then you can set the value with a 3 byte array.
I have a LIS2DE12 Accelerometer on my board, which is used to send interrupts to wake up my nRF52, which is working just fine.
What i want now, is sending the Accelerometer Data over BLE. The LIS2DE12 has 3 8-bit registers containing the data of each axis, so it's basically 3x8bits of data. I use a Vector-Library to store the data, which internally uses a double array, but i would be fine with just sending the raw 24bits and making the calculations on clientside. It would be easy to add 3 Characteristics one for every axis, but that way they could be out of sync.
Could i make a 3 byte characteristic and write the 3 axes to it directly? Which of the many characteristic types would fit for that, or would i have to define a new one