Issue with double and unsigned char type variables
The conversion to unsigned char has precedence over division.
So it first converts then divides afterwards.
Use parantheses to override:

Sample_X =  (unsigned char)(accX/129)