Arduino-processing-servomotore

ciao a tutti! mi trovo in fase di stop ahahaha. comunque, non riesco a far lavorare assieme arduino e processing, vorrei girare un servo, ho provato con il mouse e sono riuscito, ma con un altro apparecchio non riesco. in arduino ho messo esempi-firmata-standardfirmata. e in processing il codice che metto qui sotto..ps: il servo è collegato al pin digitale 9

// import the fingertracker library
// and the SimpleOpenNI library for Kinect access
import fingertracker.*;
import SimpleOpenNI.*;

// declare FignerTracker and SimpleOpenNI objects
FingerTracker fingers;
SimpleOpenNI kinect;
// set a default threshold distance:
// 625 corresponds to about 2-3 feet from the Kinect
int threshold = 625;

void setup() {
  size(640, 480);
  
  // initialize your SimpleOpenNI object
  // and set it up to access the depth image
  kinect = new SimpleOpenNI(this);
  kinect.enableDepth();
  // mirror the depth image so that it is more natural
  kinect.setMirror(true);

  // initialize the FingerTracker object
  // with the height and width of the Kinect
  // depth image
  fingers = new FingerTracker(this, 640, 480);
  // the "melt factor" smooths out the contour
  // making the finger tracking more robust
  // especially at short distances
  // farther away you may want a lower number
  fingers.setMeltFactor(100);
}

void draw() {
  // get new depth data from the kinect
  kinect.update();
  // get a depth image and display it
  PImage depthImage = kinect.depthImage();
  image(depthImage, 0, 0);

  // update the depth threshold beyond which
  // we'll look for fingers
  fingers.setThreshold(threshold);
  
  // access the "depth map" from the Kinect
  // this is an array of ints with the full-resolution
  // depth data (i.e. 500-2047 instead of 0-255)
  // pass that data to our FingerTracker
  int[] depthMap = kinect.depthMap();
  fingers.update(depthMap);

  // iterate over all the contours found
  // and display each of them with a green line
  stroke(0,255,0);
  for (int k = 0; k < fingers.getNumContours(); k++) {
    fingers.drawContour(k);
  }
  
  // iterate over all the fingers found
  // and draw them as a red circle
  noStroke();
  fill(255,0,0);
  for (int i = 0; i < fingers.getNumFingers(); i++) {
    PVector position = fingers.getFinger(i);
    ellipse(position.x - 5, position.y -5, 10, 10);
  }
  
  // show the threshold on the screen
  fill(255,0,0);
  text(threshold, 10, 20);
}

// keyPressed event:
// pressing the '-' key lowers the threshold by 10
// pressing the '+/=' key increases it by 10 
void keyPressed(){
  if(key == '-'){
    threshold -= 10;
  }
  
  if(key == '='){
    threshold += 10;
  }
}

nello sketch postato non vedo nulla di firmata,
questo è un esempio che devi integrare nello sketch processing, devi caricare la relativa libreria

e propio questo il problema. con quel codice mi si apre una schermata dove mi vedo dalla kinect, e ho le dita mappate. ma sostanzialmente non gli dico ne pin e ne niente

le librerie le ho tutte. simple-openni,open.kinect. serial. arduino firmata. funziona tutto. con il mouse ho provato e funziona. ma con la kinect no. non riesco a farla interagire, propio perché in questo codice che ho postato non fa riferimento ai pin

Secondo me devi chiedere aiuto nel forum di Processing.
Ciao Uwe

ciao , il problema e che processing non mi da problemi, va benissimo, riconosce le dita, il mio problema e dirgli ad arduino cosa deve fare quando abbasso un dito, tipo.. lo dovrei collegare in seriale, ho fatto dei test mettendogli il serial 9600 si collega ad arduino perfettamente senza problemi, ma cosa faccio a dirgli le cose?