Pages: [1]   Go Down
Author Topic: 0017 libraries with java serial example  (Read 679 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are a few examples showing how to implement a serial connection in java using the Processing libraries to talk to the arduino.

http://www.arduino.cc/playground/Interfacing/Java
http://silveiraneto.net/2009/03/01/arduino-and-java/

But, it seems that Preferences.init() has been changed for 0017.  I did find a work around. (See: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1251256638 )

I added the PrefsHack class as instructed, but as magitek described in that post I too get a bunch of NullPointerExceptions.

Code:
Exception in thread "main" java.lang.NullPointerException
        at processing.app.Preferences.getDefault(Preferences.java:788)
        at processing.app.Preferences.getFont(Preferences.java:874)
        at processing.app.Preferences.<init>(Preferences.java:372)
        at serialtest.PrefsHack.<init>(PrefsHack.java:14)
        at serialtest.Main.main(Main.java:58)
Java Result: 1
Anyone know how to get around this? Is there any documentation for the Processing libraries?
« Last Edit: November 15, 2009, 01:00:49 pm by mathieujofis » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Resolved.  Amateur mistake; tried to construct an instance of the PrefsHack library when the method I was trying to get at was static (and there was no constructor anyways).
Logged

Pages: [1]   Go Up
Jump to: