<< return to Pixycam.com

Pixy print coordinates with no blocks detected

Does pixy have a constant pixy.print() value for no blocks detected?

So far i got is result is x:23 y:8 height:19

this is the partial code for no blocks detected.
The result i got so far is this in .png file.
or is there other way to do it.
else
{
if (Serial.available() > 0)
{
input = Serial.read();
if (input == ‘y’)
{
pixy.blocks[0].print();//display pixy information
}
}
}

if i replace pixy.blocks[0].print() to serial.print(“0”) then the result is different.
Even with block detect is print 0.

This is my code. Not sure what is the problem. Need help thank you :slight_smile:

Hello Sab,
I’m not sure what you are trying to do. Are you trying to determine when Pixy is detecting 0 objects? Please describe what you are trying to do.

Edward

Hi Edward.
Okay. The program does is when i send “y” to execute the print. Even when the object detected is print out “0” instead of pixy information.

I’m trying to have a proper print of pixy information. If detected and i execute by entering “y” it should print pixy information not “0”. So I’m confused what is the problem. :frowning:

Hello Sab,
I’m sorry, but I’m not understanding what you are trying to do. Have you tried the hello_world example? It prints the pixy information correctly.

http://cmucam.org/projects/cmucam5/wiki/Hooking_up_Pixy_to_a_Microcontroller_(like_an_Arduino)

Edward