I’ve been using this program for my project
static int i = 0;
blocks = pixy.getBlocks();
sprintf(buf, “Detected %d:\n”, blocks);
for (j=0; j<blocks; j++)
sprintf(buf, " block %d: ", j);
//From here I assume Pixy is trained to see only objects of one specific colour and that there is not more than one object in the image.
// If this object is detected pin 22 is high and the position is outputted as 2 analogue voltages on DAC0 and DAC1 of an Arduino Due
Xpositie=int(float(pixy.blocks[j].x/3194095)); //Here the X-position of 0 to 319 is transformed to 0 to 4095 for the analogue output DAC0 of the arduino due.
Ypositie=int(float(pixy.blocks[j].y/1994095)); //Here the Y-position of 0 to 199 is transformed to 0 to 4095 for the analogue output DAC1 of the arduino due.
analogWrite(DAC0,Xpositie);//The transformed X-position is here outputted to DAC0
analogWrite(DAC1,Ypositie);//The transformed Y-position is here outputted to DAC1
// If there is no object detected pin 22 is low and the values of the 2 analogue voltages on DAC0 and DAC1 is not important
the problem is even if there is an object detcted there seems to be no change in the digitalpin from high to low ,even when checking for a change in the voltage on the oscilloscope (same goes for the DAC pins)