byte SA[22] = {0xf0, 0x41, 0x10, 0x42, 0x12, 0x40, 0x11, 0x40, 0x3a, 0x6d, 0x3e, 0x34, 0x0d, 0x38, 0x6b, 0x3c, 0x6f, 0x40, 0x36, 0x0f, checksum, 0xf7};
byte checksum();
byte partialSum = 0;
for (byte i = 8 ; i <= 19 ; i++)
{
partialSum += SA[i];
}
return 0x80 - (partialSum & 0x7F);
}
void loop() {
// Roland Checksum calculation
SA[20] = checksum(); //Or maybe you want to compare your checksum with SA[20]??
//The rest of your code that modifies SA[]
Jacques