Originally Posted by
bithub
So the values you are reading are numbers? How are the numbers sent across, is it binary or ascii? How are the numbers separated when they are sent across? In other words, how do you know you've reached the end of a number?
The values are numbers which are ascii. They are not separated and so I set a limit of three numbers per variable. After that, I was able to determine which numbers were two digits by using:
Code:
if(str[2]>0) // if the number is 3 digits or above 100
I also used strcmp() in order to determine actions within certain points of a particular variable:
Code:
char small[] = "130";
char large[] = "145";
if(strcmp(str,small)>0 && strcmp(str,large)<0) // Set the window between 130 and 145