<< return to Pixycam.com

Pixy with Arduino Mega loses object

Hi, I’m new to the forums so if my question has already been answered then please point me in the right direction. Thanks!

I’m using my Pixy to track a diffused LED light. The Pixy is able to track it and I can see that on PixyMon, but sometimes my Arduino says that it doesn’t see the LED. This problem generally occurs when the Pixy is looking for more than one object. Does anyone know why this might be happening?

Hi Colton,

What exactly is happening when Pixy loses the object? Is it moving? Are other objects obstructing the view of your target object?

Scott

Hey Scott,

Thanks for the reply. The object is not moving. The Pixymon shows that it can see all the objects (I have 5 signatures on the screen) when running the default program. My test Arduino program calls pixy.getBlocks(), has a delay of 75 ms, and then I iterate through pixy.blocks() and have it print all of the signatures it sees with pixy.blocks[i].print().

Interestingly, the Serial reports all the signatures (1-5) correctly at the first runtime. But after that it starts saying either that it can’t see any blocks (that blocks was not greater than 0) or it prints out the first and second color signature information and that’s it.

Why is it not reporting all the signatures?

Also, I want to be able to get new color signature data in more than one place in my loop - is this possible to do? Am I allowed to call getBlocks() more than once before the loop starts over?

I have included a picture of what Pixymon is seeing.

Thanks, I really appreciate it,

Colton

Hi Colton,

So the objects are always highlighted in Pixymon, but the data isn’t always sent to your Arduino? Try removing the 75ms delay and see if that helps. Thats kind of a long time to not read data from the comm. buffer. It would help if you could post your sketch.

Thanks.

Scott