Upload Sketch from Processing?

Is it possible to upload a sketch via processing?

Is it possible to upload a sketch via processing?

No. That wouldn't make any sense.

let me clarify

the though was for processing to do some variable and config stuff.
then using the arduino.cc class and firmata on the chip be able to upload a sketch to processing.

with the answer provided above. a different approach is required.

I have played around with a blink on roll over sketch using processing and firmata to set HIGH or LOW the pin 13 LED.
In all the reference to the arduino library for processing i have not seen any instance where i can call a method that i have create on the arduino side.

let me describe

Arduino

// firmata included
void setup(){}
void loop(){}
void customMethod(){}

Processing

/*
 some code ommited
*/
import processing.serial.*;
import cc.arduino.*;

Serial port;
Arduino arduino;

void setup()
{
   arduino = new Arduino(this, Arduino.list()[0], 57600);
}

void draw()
{
  background(#000000);
  fill(#000000);
  rect(0,0,200,200);
}

void mousePressed()
{
  /*
    i want to fire off a method called customMethod in the arduino code
    this doesn't work
  */

   arduino.customMethod();
}

This is the snippet i would like to work

void mousePressed()
{
_ /_
__
i want to fire off a method called customMethod in the arduino code*__
* this doesn't work*
_ /_
__
arduino.customMethod();__
__
}*__

can this be done?

any thought?

I hope this is what you are looking for, but I'm having trouble understanding.

You can create a processing sketch and an arduino sketch that talk to each other, but no where do they exchange code.

For example, the processing sketch could control the arduino by sending commands. The processing sketch could display icons like 'go forward' or 'stop'. When a mouse click is detected on either icon, processing sends to arduino over the serial connection a 'g' or a 's'. The arduino receives the command over the serial connection and based on a switch statement calls either the goForward() or stop() methods.

Configuration could be done the same way. Just define a bunch of commands in the arduino for setting configuration variables and have processing send them.

Thanks Andy R

So my understanding then is from processing you can only pass variables that arduino needs to absorb and determine actions.
There is no way to call methods directly then? Would be a nice to have feature i guess, but the variable passing is acceptable.

That's right.

Remote procedure calls is a big area in more sophisticated systems, but you don't expect them in systems like these. They can be very difficult to use.

And I'm glad you have all your teeth!