jlada...@itu.edu wrote:
So, how can I take the byte sequence <0x01 0x02 0x03 0x04 0x05 0x06 \n> that Serial.readline() returns to me,
Using readline() to read binary data doesn't sound like a good idea -- what happens if one of the data bytes happens to be 0x0a? If you're going binary, it would be better to ditch the newlines and read a fixed number of bytes each time. Regarding speed, if struct.unpack or numpy isn't fast enough, you may need to deal with the data in bigger chunks. Although if you're not doing a huge amount of processing with them, I'd expect it to be plenty fast enough. I just did a quick test, and I was able to unpack about 700,000 random 6-byte strings per second on a 2.8GHz Xeon. -- Greg -- https://mail.python.org/mailman/listinfo/python-list