Poblems with sending messages to processing

Hi there...

I'm making a home-made led matrix (3x3). I'm processing i made a little routine that draw nine boxes, when you click on a box this one turns to yellow and i wan't that some led turns on.
I began the arduino program with the example of the physical pixel. But, I don't know how to send from Processing to wiring that i want to certain led or leds to be turn on

any guess??

this are the codes

void draw(){
  background(175);
  for( int i = 0; i < numLeds; i++)
    b[i].dibuja();  
  for( int i = 0; i < numLeds; i++){
    b[i].presionado();
    if( b[i].daPres() < 0 ){
      b[i].actualiza();
      port.write('H');
      delay(10);
      port.write(i);
    }
    else{
      port.write('L');
      delay(10);
      port.write(i);
    }
  }
}

and

void setup(){
 for(int i = 0; i < numLeds; i++)
   pinMode( ledPin[i] , OUTPUT );
 Serial.begin(9600);
}

void loop(){
  if(Serial.available() ){
    val = Serial.read();
    delay(5);
    led = Serial.read();
  }
  if( val == 'H')
    digitalWrite( int(ledPin[led]), HIGH );
  else
    digitalWrite( int(ledPin[led]), LOW );
  delay(100);
}

thanks

I haven't had much experience with processing, but sounds like you're going to need to set a value to Each box, for example.. the first box will be a capital A (decimal value of 65) and second a lower case 'a' (decimal value of 97) etc etc.. until you have the boxes sorted! ( you can use different values, just an example)

Then on the Arduino side, you'll need to do a case statement, take a look at this here, actually you could probably copy and paste almost all of this code for your Arduino side, and just edit it to your liking!

Very easy tutorial to understand and implement! Hopefully it's that easy on the Processing side!
If you do figure it out completely you should post code on both sides, just in case anybody else has the same problem, hopefully can take some pointers of you! (cough maybe me cough) :smiley:

Best of luck, hope this helps!