Definition
- Initialer Wert:
checksum = 0 - Für jedes byte:
checksum = checksum + command byte - checksum = checksum &0xff
- Umwandeln des Hight Byte und Low Byte der Checksumme in ASCII
Beispiel
- command = $012[Enter]
- checksum = 0x24 + 0x30 + 0x31 + 0x32 = 0xB7
- checksum & 0xff = 0xB7
- checksum ASCII high byte: ASCII(0x42) = B
- checksum ASCII low byte = ASCII(0x37) = 7
- command with checksum = $012B7[Enter]