Well, I assumed you would have two characters just as you said. I assumed that they were ascii characters obtained from the serial port. I don't know how you actually get the information into your program, so my code snippet assumed that you had already obtained them and their ascii values were in c1 and c2. That is, c1 = '0' and c2 = '3' for example.
Converting the characters c1='0', c2='3' to int results in an integer value of 3. Values of '0' and '0' result in an integer value of 0. The switch is for the integer value of the two characters.
Show me what your data really is (data type and value) and tell me where it came from.
Regards,
Dave
|