Renate:
unsigned char check;
check=248;
for(i=0;i<16;i++)
check+=(data[i]>>4)+(data[i]&0x0f);
This works fine for the first 27 of 31 examples.
Either the last 4 were copied wrong or maybe there is an additional wrinkle.
Thanks for your help, however I am not being able to reproduce the checksum with your code.
For this input
unsigned char data[]={0b00000010, 0b00000000, 0b00101000, 0b00000001, 0b11000010, 0b01010010, 0b00011000, 0b00000010, 0b11000100, 0b00010011, 0b00010110, 0b00000000, 0b00000000, 0b01000000, 0b00000000, 0b00000000, 0b00101010};
I get 01000100 none of the others is correct either.
Here is a small program I created, what am I doing wrong?
#include <stdio.h>
int main(){
int i;
unsigned char check;
unsigned char data[]={0b00000010, 0b00000000, 0b00101000, 0b00000001, 0b11000010, 0b01010010, 0b00011000, 0b00000010, 0b11000100, 0b00010011, 0b00010110, 0b00000000, 0b00000000, 0b01000000, 0b00000000, 0b00000000, 0b00101010};
check=248;
for(i=0;i<16;i++)
check+=(data[i]>>4)+(data[i]&0x0f);
printf("%d",check);
return 0;
}