Regarding Strings and assignments
Almost.

First it's char not unsigned char:

char ErrorMsg[5];`


Second you don't specify a size with strcpy:

strcpy(ErrorMsg, "OK");


There is a variant of strcpy called strncpy which copies at most n characters:

strncpy(ErrorMsg, "OK", 5);


That is used to prevent buffer overruns. But when working with string literals like that it's pretty pointless.