I have one microcontroller sample from a large number of ADCs and send measurements on the radio with a very low bitrate, and bandwidth becomes a problem.
Currently, each ADC only gives us 10 bits of data and is stored in a 16-bit integer. Is there an easy way to pack them in a deterministic way, so that the first dimension is at bit 0, the second at bit 10, the third at bit 20, etc.?
To make matters worse, the microcontroller is a little essential, and I do not control the accuracy of the computer on the other side.
EDIT: For now, I like @MSN to respond best, but I will respond to comments
@EvilTeach: I'm not sure if the exact bit pattern will be useful, or how best to format it with just text, but I'll think about it.
@ Jonathan Leffler: Ideally, I would pack 8 10-bit values into 10 8-bit bytes. If this simplifies processing, I would calculate 3 values of 4 bytes or 6 values of 8 bytes (although 2 is equivalent to me, the same amount of wasted bits)
source
share