Hi Mark!
Thanks for your reply!
So basically what I get from the mcp_can.h library is a char array of 8 Bytes, representing the CAN-Message I get from the Car.
For instance this could be
"A7 03 B4 9D 00 BB 07 7D"
The message is saved in the rxBuf[0] to rxBuf[8].
I need to convert this message to binary to then again assemble the bits I need for a specific information (example: Startbit 11, Length 9).
So, for the first 2 bytes the binary should look like this:
"0B1010011100000011"
The Problem is, that as soon as there is a leading 0 in my Hex message (the second byte for example) it gets left out.
So my 0x03 converts to 0B0011 instead of 0B00000011
The zeros ahead of the 0B0011 include important information for me (example: Is the blower on or off).
Is there any way to (memory efficiently) "copy" the message into the binary format with access to each separate bit?
Thanks for your help, appreciate it.