Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    If the records are byte aligned you could use a struct with bit-fields and let the compiler do the work. tutorialspoint.com/cprogramming/c_bit_fields.htm Commented May 22, 2016 at 10:11
  • Another alternative is to define a BitStream class that operates on a Stream (Serial). Typical member function would be uint16_t read(uint8_t bits). The class would have to buffer any remaining bits for the next read, etc. drdobbs.com/bitstream-parsing-in-c/184402014 Commented May 22, 2016 at 10:13
  • 1
    I'm voting to close this question as off-topic because it's a year old question with no answers. Commented Oct 24, 2017 at 14:51
  • @LookAlterno But this one has an answer. It is/was edited into the question. I have now put that as an answer. Commented Oct 25, 2017 at 13:19