I think you're reading from the device wrong or something of that sort.
Look at what your read() function returns (assign it to new bytearray and print).
Make sure that you're geting what you expect and follow from there.
the if(bytes[x]) will do what you want as long as you check correct and valid byte.




Reply With Quote

Bookmarks