-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Board.java won't compile...Un #211
Comments
@kpolleck thanks for sharing the fix you have here. Could you submit a PR for this? Also, what version of the operating system are you using; Raspbian or Rasbian for Robots? |
hi @kpolleck, Regards |
Thanks. This seems like a coding / compling problem more than an environment problem. It appears from http://pi4j.com/apidocs/com/pi4j/io/i2c/I2CFactory.html that I2CBus throws an "UnsupportedBusNumberException"... public static I2CBus getInstance(int busNumber) ...and UnsuportedBuxNumber Exception extends Exception... public static class I2CFactory.UnsupportedBusNumberException ...but neither UnsupportedBusNumberException nor Exception are thrown or passed to higher levels... public Board() throws IOException, InterruptedException Thus, this appears to be purely a compile-time problem between Board.java and I2CFactory. |
When first compiling the java classes, I got an error related to uncaught Exceptions in Board.java. I don't quite understand how this worked for anyone as it is.
To fix this, I added try/catch code around line 91 to:
I2CBus bus = null;
try {
bus = I2CFactory.getInstance(busId);
} catch (Exception e) {
System.out.println(e);
}
device = bus.getDevice(ADDRESS);
The text was updated successfully, but these errors were encountered: