as far as i can work out, the attachment shows my interpretation of how to decode the pixy protocol, is it correct?
I would recommend alternate versions of the firmware with an improved protocol.
some ideas could be:
signify start of frame
number of objects in packet (taking account into the number that can be sent using the set baud rate)
repeat n times
_checksum
_object ID
_x
_y
_width
_height
or alternately, more like the current protocol, if the frame sync and object sync values were changed so they did not have identical values
signify start of frame
repeat n times
_signify start of object
_checksum
_object ID
_x
_y
_width
_height
signify end of frame
I personally think it is not the best protocol design at the moment because it is indistinguishable between frame and object sync, and I must read it to know, that mans I may be checking for a frame sync and accidentally get checksum data in there (because it was an object sync previously) which then means I need to indicate to the packet decoder if i should pass the checksum data to it or do a read for it, which is messy. It is also messy determining if it is the last object in the frame as the only way to do this is to count the (same value) syncs which means I have already read them just to determine that, and thus can not jump directly back to start unless dropping frames in the decode is acceptable.
Actually i seem to have gotten the no detections part wrong in the attached diagram, it is not documented anywhere. but it would seem it outputs 2 syncs, followed by checksum, signature, x, and then the rest of the values are 0, and all following frames are just a bunch of 0s with no syncs, which ads more handling complexity, A suggestion might be:
signify start of frame
_signify start of object
_checksum
_object ID=0
_x=0
_y=0
_width=0
_height=0
signify end of frame