SRF05 output

I have a SRF05 ultrasonic sensor mounted to a wireless robot. The signal from the SRF05 is run into a Arduino Duemilanove board. I am able to monitor the change is distance of a object from the serial monitor. My problem is that I would like to send this value to a the Java page so the distance can be monitored while the robot is in use. My problem is I am unsure of how to get the value out of the Duemilanove board? Here is a program that I am working with,

#include "WProgram.h"
void setup();
void loop();
int duration; // Stores duratiuon of pulse in
int distance; // Stores distance
int srfPin = 2; // Pin for SRF05
int outPin = 3; // Output Pin for SRF05!!

void setup(){
Serial.begin(9600);
pinMode(outPin, OUTPUT); // Initialize pin 3 as output!!
}

void loop(){
pinMode(srfPin, OUTPUT);

digitalWrite(srfPin, LOW); // Make sure pin is low before sending a short high to trigger ranging
delayMicroseconds(2);
digitalWrite(srfPin, HIGH); // Send a short 10 microsecond high burst on pin to start ranging
delayMicroseconds(10);
digitalWrite(srfPin, LOW); // Send pin low again before waiting for pulse back in
pinMode(srfPin, INPUT);
duration = pulseIn(srfPin, HIGH); // Reads echo pulse in from SRF05 in micro seconds
distance = duration/58; // Dividing this by 58 gives us a distance in cm
Serial.println(distance);
digitalWrite(outPin, HIGH); // Writes value to outPin 3!!
delay(50); // Wait before looping to do it again
}

int main(void)
{
init();

setup();

for (;:wink:
loop();

return 0;
}

I added in the code for the output pin and labeled it with "!!".

You are outputting the values via the serial port - presume you need to interface Java to the serial port - try googling for 'java serial interface' and have a look at gnu.io.serialport