Thanks, Andrew. I'd read the KML docs, but the implication of the last
paragraph didn't dawn on me until now.
I want to use a joystick to control Google Earth navigation. The
significance of the serial port is that my class has done lots of
labwork with serial output through variable resistors and PIC
microchips. My first thought was to let the joystick's two
potentiometers fill the role of the variable resistor. I would then
debug the joystick's output and write a Java program that translates
this output into GE-relevant values.
> That suggests that Google Earth is designed to be externally
> configured in ways that are simpler than direct interaction
> via the serial port.
If I can find an easier way to do this, my professor would probably be
open to it. But I don't see how I'm gonna get around the serial port.
JScoobyCed - 11 Nov 2005 07:17 GMT
> If I can find an easier way to do this, my professor would probably be
> open to it. But I don't see how I'm gonna get around the serial port.
There is the Java Communication API that can be used to read/write
from/to serial and parallel ports. But it needs to obey the standard
protocols.
If your joystick follows the serial communication protocol (RS-232),
then you can send binary data to the serial port, which can be read from
Java and then translated to KML.

Signature
JSC
Dag Sunde - 11 Nov 2005 08:02 GMT
> Thanks, Andrew. I'd read the KML docs, but the implication of the last
> paragraph didn't dawn on me until now.
[quoted text clipped - 13 lines]
> If I can find an easier way to do this, my professor would probably be
> open to it. But I don't see how I'm gonna get around the serial port.
So what you want is to start GE and your app. with GE showing some default
point.
When you move your joystick, you want GE to pan the map-picture N/S/E/W?
If so, Your app must know the start coordinates (Can probably get
this info from GE via KML).
Then you need to poll your joystick, registering the direction of motion,
scale/translate the joystick values into offsets from the original
coordinate (lat/lon).
Calculate a new absolute coordinate (lat/lon), and send these to GE as an
KML file.
(If I understood you correctly, that is)

Signature
Dag.
matthewburton@gmail.com - 13 Nov 2005 01:41 GMT
Dag, both you and JSC have the right idea. Thanks for your ideas.
Translating the serial data into XML strings won't be a problem. What
I'm unsure of is how to write these strings to a file. My default
coordinates are in an existing KML file, and I just want to tell Java,
"replace those coordinates with the ones I just created."
It's essential that the program be able to do update the data
perpetually, with every move/click on the joystick.