Fixed motor count buffer overflows by using uint16_t in place of uint8_t