I’m sending a byte array to a piece of hardware.
The first 7 bytes contain data and the 8th byte is a checksum.
The 8th byte is the Least Significant Byte of the sum of the first 7 bytes.
Examples that include the correct checksum. The last byte of each of these is the checksum
200-30-7-5-1-2-0-245
42-0-0-1-176-0-148-39
42-0-0-3-177-0-201-118
How do I calculate the checksum?
Thanks,
Seth
Same as in C: take the sum and ‘bitwise and’ it with 255 (or 0xff in hexadecimal). Using your first set of data as an example: