1 0 end _ _ __ | |_ | |__ | | 650/520 650/1100 1850 OOOMMXXXXXXXXRCC OOO - regular command 000 - turn off 001 MM - current mode R - 0 for initial press, 1 for repeat CC - checksum -- every two bits, XORed (see pseudocode below) XXXXXXXX - button code BUTTON CODES: star: 01111111 triangle: 11110111 circle: 11101111 square: 11011111 heart: 10111111 cloud: 11111011 roll: 11111101 mode set: 11111111 exit: 11111110 release (all): 00000000 (R can potentially be set or unset!) turn off: 11111111 (x2, with OOO set to 001) NOTES: - When holding down a button, pressing a second button causes that button code to start without a release code in between. Afterwards, the release code may have the repeat bit set. - Neither "mode set" nor "turn off" use release codes. "Mode set" specifies the new mode with the MM bits. CHECKSUM CALCULATION PSEUDOCODE: int checksum = 0; int bitpair = 0; for (int ibit = 0; ibit < 15; ibit ++) { if (ibit % 2 == 0) bitpair = bitstream[ibit] << 1; else { bitpair = bitpair | bitstream[ibit]; checksum = checksum ^ bitpair; } }