<< return to Pixycam.com

Pixy2 serial protocol getResolution()


#1

Hi,
I got a question about getRsolution() in Pixy2 serial protocol. According to the doumentation it’s supposed to return 10 bytes, but I only receive 8 bytes. Last two bytes have value 316 so that should be the width (in color connected mode). So it seems to lack the height of the image. Or am I doing something wrong?

This is what I receive:
175
193
13
4
13
1
60
1

Regards,
Kees


#2

Hello Kees,
It’s true that you should get 10 bytes. I’m not sure why the height is being cut off. What usually happens is after the sync word is found, 2 bytes are read to get the type and length and then you add 2 bytes to the length and read that many bytes (in this case 6).

What kind of serial are you using? If you are using UART, be sure that your FIFO isn’t overrunning due to printing.

Edward


#3

Hi Edward,

I found the problem, it was my ow fault: I created a buffer of only 8 bytes… The risc of copy/paste code from other parts of my program. With a buffer of 10 bytes the height is returned as well.

Kees


#4

That’s good news :+1::+1: