Hi tuxduino, no I didn't thought about that, but I'm interested in you theory however I do not fully understand you because I'm a complete newbie at Arduino IDE. Could you explain yourself a little more?
The idea, at its core, is simple: suppose you have a delay of n seconds in a sketch and you want the user to be able to change it. Instead of writing
const int BLINK_DELAY_S 2 // at top of sketch
...
// later, somewhere inside the code...
delay(BLINK_DELAY_S * 1000);
and instruct the user to change "2" with e.g. "3" to have a 3 seconds delay, you write a program which has a default delay value but accepts simple (ascii-based) commands through the serial port to change that delay value at runtime.
To give you a simple, although not very robust, example, let's consider a sketch that lets you turn on and of the built-in led.
O means "turn the led On", F means turn the led oFf.
( disclaimer: only an untested snipped of code! )
void loop() {
char ch;
if (Serial.available() > 0) {
ch = Serial.read();
switch(ch) {
case 'O':
digitalWrite(13, HIGH);
break;
case 'F':
digitalWrite(13, LOW);
break;
}
}
}
Usage: open the serial monitor, type O or F and hit "send".
There are smarter and better ways to implement this, but you get the idea.
The next step is to handle commands with parameters (e.g. S10 could mean "set Speed to 10%").
Then comes the ability to store certain values in EEPROM and reload them at sketch startup.
Then...
Once you have this all working, you can write a java application that sends those commands through the serial port like the Arduino serial monitor, but instead of forcing the user to type letters and values, it provides the usual UI controls (buttons, trackbars, etc.) and handles all the protocol and conversion issues under the hood.
To control the above example, you'd just need a button with label "ON" and an "onPressed" event handler that would write('0') to the serial port and another button with label "OFF" that would wirte('F') instead.