Hello!
I’m working on using the Pixy2’s line tracking function and would like to command the camera to manually select a different line to track when a barcode appears in the viewport. A snippet of the Arduino code I’ve written so far is:
else if (pixy.line.barcodes->m_code==0){
F=pixy.line.numVectors;
Serial.println(“change vector!”);
pixy.line.setMode(LINE_MODE_MANUAL_SELECT_VECTOR);
pixy.line.setVector(F);
}
In my mind, this code should cause the detection of the “zero” barcode to trigger a change in which of the two lines in the viewport is the vector, causing the line that is currently green to light up red and the red line to turn some other color. The barcode detection is working fine as evidenced by the print statement in the third line executing successfully. However, the vector does not change from the original one. I’m not sure if I’m running the setVector command properly though, and am wondering if someone can point me in the right direction?