<< return to Pixycam.com

Pixy Communication with UART

Hi, I am using UART to communicate with the PIXY Camera. I am trying to track an object based on where x coordinates and where the object is in frame. I get weird numbers when I try to read the x-coordinates (ex. 36 when fully left, 250 in the middle and then 50 when it is very right). My problem could either be that the Pixy camera is not sending data correctly, I could be reading the data incorrectly with UART, or I do not know what the parameters are for the x-coordinates.

Does anyone knows how to track an object using the x-coordinates ?
And what is start word I should be looking for in the camera ?

Hello Mohit,
Are you using an Arduino? If not, What platform are you using? Our porting guide has some good information about interfacing Pixy and Pixy’s serial protocol:

http://cmucam.org/projects/cmucam5/wiki/Porting_Guide

Regarding UART communication on Pixy, it does not have any flow control, so it’s easy for the data from Pixy to “overrun” and be lost unless you have a fast polling routine or an interrupt-driven buffer of some sort. When this happens, the data is incomplete and full of errors. I2C and SPI have built-in flow control and may be easier to use.

Edward