mbed and Java

I have got hold of a Inertia Measurement Unit Combo Board containing a gyroscope and accelerometer from Sparkfun and wanted to do something a bit beyond my normal routine of outputting some numbers to Tera Term.

I have done a bit of java at uni recently and was impressed with how easy it was to create professional looking GUIs and applications, so I thought I would try to make an application that displayed the data gathered by the IMU board that was a bit easier on the eye than reams of scrolling numbers.

I looked at the Interfacing with Java cookbook page and try to run the mbedRPC_HelloWorld. To this end I needed to download some java libraries and configure Eclipse.

Eclipse IDE

So I copied the mbedRPC_HelloWorld program into Eclipse and download the mbedRPC.jar file and put it into a folder I created in the Eclipse project called 'lib' as shown below.

/media/uploads/ms523/eclipse.jpg

I then pointed Eclipse to this .jar file by right-clicking and selecting 'properties' and adding the file to the Java build path

/media/uploads/ms523/untitled.jpg

I then compile and run the program and hey presto the LEDs on the mbed flash as expected.

Java Application

So I can use java to interface with mbed, now to create a GUI...

To be continued...


1 comment on mbed and Java:

26 Jul 2011

Hi Martin I am fairly new to Java, and been having difficulties interfacing it with mbed. (I did get it working with C++) Could you kindly elaborate on how you configured Eclipse to run it with mbed? Also, where exaclty should I be storing my mbedRPC_1.jar and the serialRXtX files? Right now, I am not even able to run the basic HelloWorld function? Thanking you in advance for your help.

Please log in to post comments.