due_can icon indicating copy to clipboard operation
due_can copied to clipboard

How to read and write individual bits to the canbus?

Open hpfiend opened this issue 2 years ago • 1 comments

Hey all - Does anyone know the proper syntax to read and then send data to individual bits of an address id byte ?

Thank you!

hpfiend avatar Feb 22 '24 01:02 hpfiend

Let's say you have a "CAN_FRAME frame;" variable.

Then, the syntax to get and set bits is frame.data.bit[34] = 1; where the 34 can be 0-63 and references each bit in the message.

collin80 avatar Feb 27 '24 02:02 collin80