<< return to Pixycam.com

frames and block problems

hello

I am an engineering student and now i am working on a project where i need to calculate angle between 2 objects , so i need the coordinates of 2 objects but i only get 1 block per frame , only data about 1 object (about the first signature in the row) . I am working with stm32f411 nucleo-64 and I2C but that schould be no problem , and my second problem (more a question ) is can i somehow change the resolution of pixy for e.g. now pixy sends to my microcontroller objects within 320x240 pixels but can i change it maybe to 640 x320 or something else ?

Hello Dag,
It looks like you are getting valid data out of Pixy. The number 43605 is 0xaa55 in hex, which is the sync word. You can find more information on Pixy’s protocol here:

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

You can’t change Pixy’s resolution resolution currently. (sorry)

Edward

HI Edward and thanks on your quick answer

I used those information but i don’t know what am i doing wrong , because when i put more objects in front of the pixy i only get one block per frame and in that block just info about the first signature in row for e.g. i put blue and red object and i just get frames with 1 block and it has data about red object even if the blue one is bigger . When there are 2 object in front of camera do i need to send something to pixy registers to receive data from other objects ?

I read somewhere that pixy just sends data and we don’t need to send anything.

When there are 2 sync words one after another it is the begin of a new frame , do i need to add something to my code or change some settings in pixymon ?

	i2c.read(address ,data,2) ;
	
	value =(((int)data[1] << 8) | (int)data[0]) ;
	pc.printf ("%d\n" ,value  ) ;

Hello Dag,
One issue might be that you aren’t reading fast enough. Pixy is an I2C slave, so it relies on the master to clock out the data. If the data clock is slow or if you are printing numbers to a terminal at 9600 baud (for example), you won’t get much data out before the next frame comes in (every 20 milliseconds). Have you tried removing your printf’s?

Edward

Ok i don’t know what i did but this is working and i am still writing all the data on serial port and getting 50 frames per second .I just played a little bit with the frequency of I2C and it is working ,now it is 100kHz.

Thanks EDWARD !!! :smiley:

Glad you got it working! :slight_smile: