Digital pin problem arduino due/pixy

I’ve been using this program for my project
#include <SPI.h>
#include <Pixy.h>

Pixy pixy;

void setup()
{
analogWriteResolution(12);
pinMode(22, OUTPUT);
Serial.begin(9600);
Serial.print(“Starting…\n”);
pixy.init();
}

void loop()
{
static int i = 0;
int j;
uint16_t blocks;
char buf[16];
int Xpositie;
int Ypositie;

blocks = pixy.getBlocks();

if (blocks)
{
i++;

if (i%50==0)
{
sprintf(buf, “Detected %d:\n”, blocks);
Serial.print(buf);
for (j=0; j<blocks; j++)
{
sprintf(buf, " block %d: ", j);
Serial.print(buf);
pixy.blocks[j].print();
//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
if (pixy.blocks[j].signature==1)
{
digitalWrite(22, HIGH);
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/199
4095)); //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
delay(50);
}
// 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
else
{
digitalWrite(22, LOW);
delay(50);
}
}
}
}
}

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)

Not familiar with Pixy.h, however regarding the analog output on the Due, it outputs in range of 1/6 to 5/6 of Vcc, which is 0.55 - 2.75V.