It’s very easy to set an output pin with Arduino. Just set the pin as an output pin in your setup() function:
pinMode(thePin, OUTPUT);
then to turn it “on” (5V) and “off” (0V), use
digitalWrite(thePin, HIGH); // set it to 5V
and
digitalWrite(thePin, LOW); // set it to 0V
That’s all there is to it. So, you can use the object tracking example and based on the coordinates set pins HIGH and LOW based on your needs. Keep in mind that the Video Experimenter uses pins 2, 6, 7, 8, 9 and A2. There are plenty of other pins left for you to use.
See the Arduino site arduino.cc for everything you need to learn Arduino coding.