I figured out how to use JSSC when i need to write bytes. But i haven't figured out. How i can get value to Java by reading value from arduino analog in.
My code on arduino:
int analogPin = 3; // potentiometer wiper (middle terminal) connected to analog pin 3
// outside leads to ground and +5V
int val = 0; // variable to store the value read
void setup()
{
Serial.begin(9600); // setup serial
}
void loop()
{
val = analogRead(analogPin); // read the input pin
Serial.println(val); // debug value
}
The documentation (Javadocs) for JSSC are included in the download.
If you have studied the JRuby example that I referred you to in another Thread you will see that I used the readBytes() method within JSSC.
It seems to me it would be much more useful for you if you asked all these questions in the same Thread so that people here could see all the background.