WEBCAM+OF+ARDUINO+SERVOS help

Hello to every one.I have a graditude project that seems to be not so easy.I want to move robo arm with two servos(1st-left-right)(2nd-ip-down).I have the code from Joshua but i cant compile it.The files are:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
main:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#include “openFrameworks\ofMain.h”
#include “servoApp.h”

int main() {
ofSetupOpenGL( 1024,768, OF_WINDOW );
ofRunApp( new servoApp() );
}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
after that;
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#include “servoApp.h”

void servoApp::setup() {
ofSetFrameRate( 60 );
threshold = 60;
bLearnBakground = true;
// this will print out all of the devices attached to your computer
serial.enumerateDevices();
//serial.setup(“COM4”); // windows will look something like this.
serial.setup("/dev/cu.usbserial-A6004nTt",9600); // mac osx looks like this
//serial.setup("/dev/ttyUSB0", 9600); //linux looks like this

vidGrabber.setDeviceID(5);
vidGrabber.initGrabber( 320, 240 );
colorImg.allocate( 320, 240 );
grayImg.allocate( 320, 240 );
bgImg.allocate( 320, 240 );

vidGrabber2.setDeviceID(4);
vidGrabber2.initGrabber(320, 240, true);
}

void servoApp::update() {
ofBackground( 100, 100, 100 );
vidGrabber.grabFrame();
vidGrabber2.grabFrame();

int i, len, largest;

if( vidGrabber.isFrameNew() ) {
colorImg = vidGrabber.getPixels();
grayImg = colorImg;

if( bLearnBakground ) {
bgImg = grayImg;
bLearnBakground = false;
}

grayImg.absDiff( bgImg );
grayImg.blur( 11 );
grayImg.threshold( threshold );

contourFinder.findContours( grayImg, 50, 20000, 10, false );
largest = -1;
i = 0;
if(contourFinder.blobs.size() > 0) {
int len = contourFinder.blobs.size() - 1;
while(i<len){
if(largest == -1) {
largest = i;
}
else if(contourFinder.blobs.at(i).area > contourFinder.blobs.at(largest).area) {
largest = i;
}
i++;
}
// this is important: we don’t want to send data to the serial port
// on every frame because the Arduino runs much more slowly than the
// oF app.
if(ofGetFrameNum() % 4 == 0) {
if(largest != -1) {
serial.writeByte(contourFinder.blobs.at(largest).centroid.y/240 * 255);
serial.writeByte(contourFinder.blobs.at(largest).centroid.x/320 * 255);
}
}
}
}

@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@
and header file:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

#include “ofMain.h”
#include “ofxCvMain.h”

class servoApp : public ofBaseApp {

public:

int cwidth;
int cheight;
ofVideoGrabber vidGrabber;
ofVideoGrabber vidGrabber2;

ofxCvColorImage colorImg;
ofxCvGrayscaleImage grayImg;
ofxCvGrayscaleImage bgImg;

ofxCvContourFinder contourFinder;

int threshold;
bool bLearnBakground;

void setup();
void update();
void draw();

void keyPressed( int key );
ofSerial serial;

};
@@@@@@@@@@@@@@@@@@@@@@@@@@
this is the files on arduino
@@@@@@@@@@@@@@@@@@@@@@@@@@
#define DSERVO_TWO_X_PIN 3
#define DSERVO_TWO_Y_PIN 4

#include <Servo.h>

Servo vert;
Servo horz;
byte xy[2];

void setup() {
horz.attach(3);
vert.attach(5);

Serial.begin(9600);

}

void loop() {

if(Serial.available() > 1) {
xy[0] = Serial.read();
xy[1] = Serial.read();

// now that we have the xy we can go ahead
// and write them to the serial
float ratio = 180.0/255.0;
horz.write(xy[0] * ratio);
vert.write(xy[1] * ratio);
delay(25);
}

}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
How to compile those files.Please help.

Hi
I do recently something with opencv+arduino+anlog sevo, but using firmata library. So you can sendservo to a angle position. I can post you some code if helps

Hi again,

Ok, you need to download openFrameworks from here: http://www.openframeworks.cc/download and then follow the setup guide here: http://www.openframeworks.cc/setup

If you want to run the webcam+servo example that you wrote me about earlier you need to put the files into the src folder of a folder with an openframeworks application. After you download OF you’ll see a bunch of examples in apps/examples. You can download the application (here it’s in XCode format, only computer I have at the moment) from here http://thefactoryfactory.com/servos.zip and put it in that apps/examples and you should be able to run it. A quick word of advice: take some time and see how the examples are set up, how the applications are structured, it’ll help in the future.

Hope that helps.

Thanks man but i have a few more questions :
1.Windows or LINUX i chose
2.and what i choose Codeblocks or visual 2008
3.and what version of OF i have to download,latest or previous

yes post it in here.Thank you:)

1.Windows or LINUX i chose

That’s up to you?

2.and what i choose Codeblocks or visual 2008

That’s also up to you. CodeBlocks is probably easier.

3.and what version of OF i have to download,latest or previous

The newest, 007, is recommended.