https://subethasoftware.com/2014/12/16/splitting-a-16-bit-value-to-two-8-bit-values-in-c/
Splitting a 16-bit value to two 8-bit values in C