Doesn't seem like that should be there, it should be handled in getDistance instead, if that's what you're waiting for. And I think the best solution at this point is to just throw readData into a loop that keeps looking for the data. In an ideal situation we'd put the thread to sleep until the right amount of information was in the buffer, but we don't have time to get that done I don't think.
Doesn't seem like that should be there, it should be handled in getDistance instead, if that's what you're waiting for. And I think the best solution at this point is to just throw readData into a loop that keeps looking for the data. In an ideal situation we'd put the thread to sleep until the right amount of information was in the buffer, but we don't have time to get that done I don't think.