You need the divide by 8 in the data 2 statement. I used the better shift right method in place of the divide by 8.
As I said you need the full 10 bits to do the “only send it if it has changed” bit.
I left it in that code but commented out so you could see the place it used to be.