I am having a problem reading from a serial port every-time that I read from the port I get a different value and even (most of the time) more than one output, Thus I am stuck these are snip its from a much larger code that runs prefect except for this portion.
and I did I thought I had everything set right (well now I know that I have to make sure it did not fail but) other then that everything is set right and it was in a thread before and when I added the timeouts things started to get weird
what is your expected output anyway?
how many bytes of data are you expecting?
i would recommend to read the exact amount of bytes.
if possible try to add a checksum to the packet and a start of transmission and end of transmission character. so you know exactly what to expect. it will be easier to parse the data also.
The expected output from the scale I am working with should be 3.098 oz (I could do without the oz I just technically need the number) and I have tried to read the exact number and it gives me the same thing I am just having the problem of figuring out why it is random everytime