encode_cmd() verified with 3 controllers

The encode_cmd() which converts the command string
to bytes to be written over SPI has been verified
with three controllers.  Both the nibbles in a byte
and the byte order had to be changed.