<< return to Pixycam.com

Pixy2 line following, no arduino

Hello,

Please help me understand the received data and determine the position of the line vector. My device uses the UART interface to communicate with pixy2. I am sending a getMainFeatures query for pixy: 0xc1ae, 0x30, 0x02, 0x00, 0x01.
Receives the answer as in the pictures below (according to the position of the lines in the picture):

According to the Line Tracking - Packet Reference:

For a more recent example, I understand it like this:
0xc1af - sync
0x31 - type of packet
0x08 - lenght of packet
0x9300 - sum of payloads bytes

the next data is a mystery…
Probably the data of x0, x1, y0, y1 - but I can’t calculate the vector’s position from this.

Can someone explain it to me? I need to calculate the position of the line vector from this data.

BR
Burg

Hello,
Byte 6 is either a 1, 2, or a 4 depending on whether it’s Vector, Intersection or Barcode.

If it’s a 1, it’s a Vector and has the format like you’re guessing:
uint8_t m_x0
uint8_t m_y0
uint8_t m_x1
uint8_t m_y1
uint8_t m_index
uint8_t m_flags

The Arduino code might help also:

Hope this helps!

Edward

Hi Edward,

thank you for the information. I managed to get all the data and my robot follows the line :slight_smile:

BR
Burg

1 Like