How to log arrays

Firmware/software/electronics/mechanics
Post Reply
chopin
Beginner
Posts: 6
Joined: Thu Sep 26, 2019 5:39 am

How to log arrays

Post by chopin » Mon Oct 28, 2019 12:35 pm

Hello, I've seen here https://github.com/bitcraze/crazyflie-f ... .h#L54-L62 that you can only log ints or floats.
We have a sensor that sends many measurements so we wanted to know whether there's a convenient way to send them all in one array (or something similar) instead of having a lot of `LOG_ADD`s.
Thanks!



tobias
Bitcraze
Posts: 1911
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How to log arrays

Post by tobias » Tue Oct 29, 2019 9:12 am

How big is the array? If you can fit it within on log packet (26 bytes) it is efficient as it only contains the binary data.

chopin
Beginner
Posts: 6
Joined: Thu Sep 26, 2019 5:39 am

Re: How to log arrays

Post by chopin » Thu Oct 31, 2019 6:31 am

The array has 18 `uint16_t`s. For now we just `LOG_ADD` 18 times and it works fine, we just wanted to know whether there's a more elegant way of doing this.

Post Reply