<< return to Pixycam.com

Counting Detected objects using Pixy2 and arduino

Hello, I just bought Pixy2 cam for our object detection project using it with Arduino, I’m having trouble counting the objects that pixy2 detects to print in our LCD can someone suggest a parameter to get how many objects does the pixy2 cam detecting and the object is not moving. For example i place 1 green ball and 1 blue ball it should return 2 objects detected.

Hello,
You should try running the ccc_hello_world example:

https://docs.pixycam.com/wiki/doku.php?id=wiki:v2:hooking_up_pixy_to_a_microcontroller_-28like_an_arduino-29

Line 46 of the source code shows how you get the number of blocks (via pixy.ccc.numBlocks).

Edward