<< return to Pixycam.com

Pixy detected that no object is in front of him

I am working on a robot arm which can detect and tracking objects.
Pixy is the eye of the robot arm.
The controller is Arduino mega 2560.
I know that I can use getBlocks() to detect a certain object in front of Pixy.
However, if the object is taken away, how do I let Arduino know that Pixy detects that?

For example:

@pixy.getBlock()@
@if (pixy.blocks[0].x >= 250 && pixy.blocks[0].x < 319){
//servo move right
}
else if (pixy.blocks[0].x <= 110 && pixy.blocks[0].x > 0){
//servo move left
}
else if (//block[0] is out of the camera frame)@

How can I let Arduino know that block [0] is out of the camera frame?

Hello Kien,
I may be misunderstanding your question, but this thread describes an issue where detecting no object requires inserting a 20 ms delay.

Please read this thread:
http://cmucam.org/boards/9/topics/5734?r=5758#message-5758

Let me know if this helps with your question.

Edward