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?