diff --git a/examples/java/A110XSample.java b/examples/java/A110XSample.java index 72731049..36bcc5bc 100644 --- a/examples/java/A110XSample.java +++ b/examples/java/A110XSample.java @@ -24,15 +24,6 @@ public class A110XSample { - static { - try { - System.loadLibrary("javaupm_a110x"); - }catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { //! [Interesting] // Instantiate an A110X sensor on digital pin D2 diff --git a/examples/java/A110X_intrSample.java b/examples/java/A110X_intrSample.java index 50b83029..2c052824 100644 --- a/examples/java/A110X_intrSample.java +++ b/examples/java/A110X_intrSample.java @@ -28,15 +28,6 @@ public class A110X_intrSample { public static int counter=0; - static { - try { - System.loadLibrary("javaupm_a110x"); - }catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { //! [Interesting] // Instantiate an A110X sensor on digital pin D2 diff --git a/examples/java/ADC121C021Sample.java b/examples/java/ADC121C021Sample.java index 54ca02b2..5e34cd4a 100644 --- a/examples/java/ADC121C021Sample.java +++ b/examples/java/ADC121C021Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class ADC121C021Sample { - static { - try { - System.loadLibrary("javaupm_adc121c021"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate an ADC121C021 on I2C bus 0 diff --git a/examples/java/Adxl345Sample.java b/examples/java/Adxl345Sample.java index 9b19b3df..028f6583 100644 --- a/examples/java/Adxl345Sample.java +++ b/examples/java/Adxl345Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class Adxl345Sample { - static { - try { - System.loadLibrary("javaupm_adxl345"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] short[] val; diff --git a/examples/java/Apds9002.java b/examples/java/Apds9002.java index fc9cc619..4bb5de8f 100644 --- a/examples/java/Apds9002.java +++ b/examples/java/Apds9002.java @@ -26,18 +26,6 @@ import upm_apds9002.APDS9002; public class Apds9002 { - static { - try { - System.loadLibrary("javaupm_apds9002"); - System.loadLibrary("mraajava"); - } catch (UnsatisfiedLinkError e) { - System.err.println( - "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + - e); - System.exit(1); - } - } - public static void main(String[] args) { // TODO Auto-generated method stub //! [Interesting] @@ -56,4 +44,4 @@ public class Apds9002 { //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/BISS0001Sample.java b/examples/java/BISS0001Sample.java index 7d7a4662..eaacacfa 100644 --- a/examples/java/BISS0001Sample.java +++ b/examples/java/BISS0001Sample.java @@ -24,15 +24,6 @@ public class BISS0001Sample{ - static { - try { - System.loadLibrary("javaupm_biss0001"); - }catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { //! [Interesting] // Instantiate a Grove Motion sensor on GPIO pin D7 diff --git a/examples/java/BMPX8XSample.java b/examples/java/BMPX8XSample.java index 2c6aeb80..c8031215 100644 --- a/examples/java/BMPX8XSample.java +++ b/examples/java/BMPX8XSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class BMPX8XSample { - static { - try { - System.loadLibrary("javaupm_bmpx8x"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a BMPX8X sensor on I2C diff --git a/examples/java/BuzzerSample.java b/examples/java/BuzzerSample.java index 30dbb1d8..e94be7fe 100644 --- a/examples/java/BuzzerSample.java +++ b/examples/java/BuzzerSample.java @@ -24,15 +24,6 @@ public class BuzzerSample { - static { - try { - System.loadLibrary("javaupm_buzzer"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] int chord[] = { diff --git a/examples/java/Buzzer_soundSample.java b/examples/java/Buzzer_soundSample.java index 9797d2e4..576d8886 100644 --- a/examples/java/Buzzer_soundSample.java +++ b/examples/java/Buzzer_soundSample.java @@ -24,15 +24,6 @@ public class Buzzer_soundSample { - static { - try { - System.loadLibrary("javaupm_buzzer"); - }catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { //! [Interesting] int chord[] = { diff --git a/examples/java/CJQ4435Sample.java b/examples/java/CJQ4435Sample.java index 90a0a76b..333c20ea 100644 --- a/examples/java/CJQ4435Sample.java +++ b/examples/java/CJQ4435Sample.java @@ -24,15 +24,6 @@ public class CJQ4435Sample { - static { - try { - System.loadLibrary("javaupm_cjq4435"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // Instantiate a CJQ4435 MOSFET on a PWM capable digital pin D3 upm_cjq4435.CJQ4435 mosfet = new upm_cjq4435.CJQ4435(3); diff --git a/examples/java/DS1307Sample.java b/examples/java/DS1307Sample.java index a0785f8c..89ae5dc6 100644 --- a/examples/java/DS1307Sample.java +++ b/examples/java/DS1307Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class DS1307Sample { - static { - try { - System.loadLibrary("javaupm_ds1307"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - static private void printTime(upm_ds1307.DS1307 rtc) { System.out.print("The time is: " + rtc.getMonth() + "/" + rtc.getDayOfMonth() + "/" + rtc.getYear() + " " + rtc.getHours() + ":" + rtc.getMinutes() + ":" diff --git a/examples/java/ENC03RSample.java b/examples/java/ENC03RSample.java index 1d2e4bb1..c2aa0bd5 100644 --- a/examples/java/ENC03RSample.java +++ b/examples/java/ENC03RSample.java @@ -26,15 +26,6 @@ public class ENC03RSample { private static final long CALIBRATION_SAMPLES = 1000; - static { - try { - System.loadLibrary("javaupm_enc03r"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] diff --git a/examples/java/ES08ASample.java b/examples/java/ES08ASample.java index 1726fd66..02852043 100644 --- a/examples/java/ES08ASample.java +++ b/examples/java/ES08ASample.java @@ -23,15 +23,6 @@ */ public class ES08ASample { - static { - try { - System.loadLibrary("javaupm_servo"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_servo.ES08A servo = new upm_servo.ES08A(6); diff --git a/examples/java/GROVESCAMSample.java b/examples/java/GROVESCAMSample.java index 176c4aea..1e4a3743 100644 --- a/examples/java/GROVESCAMSample.java +++ b/examples/java/GROVESCAMSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class GROVESCAMSample { - static { - try { - System.loadLibrary("javaupm_grovescam"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a Grove Serial Camera on UART 0 diff --git a/examples/java/GUVAS12DSample.java b/examples/java/GUVAS12DSample.java index 1f90215a..0cd41156 100644 --- a/examples/java/GUVAS12DSample.java +++ b/examples/java/GUVAS12DSample.java @@ -27,15 +27,6 @@ public class GUVAS12DSample { private static final float GUVAS12D_AREF = 5; private static final int SAMPLES_PER_QUERY = 1024; - static { - try { - System.loadLibrary("javaupm_guvas12d"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a GUVAS12D on analog pin A3 diff --git a/examples/java/GroveButton_intrSample.java b/examples/java/GroveButton_intrSample.java index 6da7b784..214e9c6f 100644 --- a/examples/java/GroveButton_intrSample.java +++ b/examples/java/GroveButton_intrSample.java @@ -29,15 +29,6 @@ public class GroveButton_intrSample { public static int counter = 0; - static { - try { - System.loadLibrary("mraajava"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_grove.GroveButton b = new upm_grove.GroveButton(2); diff --git a/examples/java/GroveCollision.java b/examples/java/GroveCollision.java index 0fa9f31d..ab95fcac 100644 --- a/examples/java/GroveCollision.java +++ b/examples/java/GroveCollision.java @@ -26,19 +26,6 @@ import upm_grovecollision.*; public class GroveCollision { - static boolean shouldRun = true; - static { - try { - System.loadLibrary("javaupm_grovecollision"); - System.loadLibrary("mraajava"); - } catch (UnsatisfiedLinkError e) { - System.err.println( - "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + - e); - System.exit(1); - } - } - public static void main(String[] args) { // TODO Auto-generated method stub // Initializing the sensor on D2 on the Base Shield @@ -60,4 +47,4 @@ public class GroveCollision { System.out.println("Exiting"); } -} \ No newline at end of file +} diff --git a/examples/java/GroveEHRSample.java b/examples/java/GroveEHRSample.java index 6514af2f..ddec36ac 100644 --- a/examples/java/GroveEHRSample.java +++ b/examples/java/GroveEHRSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class GroveEHRSample { - static { - try { - System.loadLibrary("javaupm_groveehr"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a Grove Ear-clip Heart Rate sensor on digital pin D2 diff --git a/examples/java/GroveEmg.java b/examples/java/GroveEmg.java index 9766b05d..eaa8ba04 100644 --- a/examples/java/GroveEmg.java +++ b/examples/java/GroveEmg.java @@ -25,18 +25,6 @@ import upm_groveemg.GroveEMG; public class GroveEmg { - static { - try { - System.loadLibrary("javaupm_groveemg"); - System.loadLibrary("mraajava"); - } catch (UnsatisfiedLinkError e) { - System.err.println( - "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + - e); - System.exit(1); - } - } - public static void main(String[] args) { // TODO Auto-generated method stub //! [Interesting] @@ -56,4 +44,4 @@ public class GroveEmg { } } //! [Interesting] -} \ No newline at end of file +} diff --git a/examples/java/GroveGsr.java b/examples/java/GroveGsr.java index 091fbd45..08a04b9d 100644 --- a/examples/java/GroveGsr.java +++ b/examples/java/GroveGsr.java @@ -26,18 +26,6 @@ import upm_grovegsr.GroveGSR; public class GroveGsr { - static { - try { - System.loadLibrary("javaupm_grovegsr"); - System.loadLibrary("mraajava"); - } catch (UnsatisfiedLinkError e) { - System.err.println( - "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + - e); - System.exit(1); - } - } - public static void main(String[] args) { // TODO Auto-generated method stub @@ -59,4 +47,4 @@ public class GroveGsr { //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/GroveLEDSample.java b/examples/java/GroveLEDSample.java index 97961c20..b9964490 100644 --- a/examples/java/GroveLEDSample.java +++ b/examples/java/GroveLEDSample.java @@ -23,15 +23,6 @@ */ public class GroveLEDSample { - static { - try { - System.loadLibrary("javaupm_grove"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main (String args[]) throws InterruptedException { //! [Interesting] upm_grove.GroveLed led = new upm_grove.GroveLed(2); diff --git a/examples/java/GroveLed_multiSample.java b/examples/java/GroveLed_multiSample.java index d2a400f4..98d792c7 100644 --- a/examples/java/GroveLed_multiSample.java +++ b/examples/java/GroveLed_multiSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class GroveLed_multiSample { - static { - try { - System.loadLibrary("javaupm_grove"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a grove LED on D2. Here we are controlling a Grove diff --git a/examples/java/GroveLightSample.java b/examples/java/GroveLightSample.java index cf9ec35a..611b744b 100644 --- a/examples/java/GroveLightSample.java +++ b/examples/java/GroveLightSample.java @@ -23,15 +23,6 @@ */ public class GroveLightSample { - static { - try { - System.loadLibrary("javaupm_grove"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String args[]) throws InterruptedException { // ! [Interesting] upm_grove.GroveLight gl = new upm_grove.GroveLight(2); diff --git a/examples/java/GroveLineFinderSample.java b/examples/java/GroveLineFinderSample.java index 95a3b1d9..2baa418a 100644 --- a/examples/java/GroveLineFinderSample.java +++ b/examples/java/GroveLineFinderSample.java @@ -24,15 +24,6 @@ public class GroveLineFinderSample { - static { - try { - System.loadLibrary("javaupm_grovelinefinder"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a Grove Line Finder sensor on digital pin D2 diff --git a/examples/java/GroveMDSample.java b/examples/java/GroveMDSample.java index 19d16f60..9bb4bb7a 100644 --- a/examples/java/GroveMDSample.java +++ b/examples/java/GroveMDSample.java @@ -26,15 +26,6 @@ public class GroveMDSample { private static final short speed50 = 127; private static final short speed0 = 0; - static { - try { - System.loadLibrary("javaupm_grovemd"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate an I2C Grove Motor Driver on I2C bus 0 diff --git a/examples/java/GroveMQ3.java b/examples/java/GroveMQ3.java index 3406dd64..c101189c 100644 --- a/examples/java/GroveMQ3.java +++ b/examples/java/GroveMQ3.java @@ -36,18 +36,6 @@ import upm_gas.thresholdContext; public class GroveMQ3 { - static { - try { - System.loadLibrary("javaupm_gas"); - System.loadLibrary("mraajava"); - } catch (UnsatisfiedLinkError e) { - System.err.println( - "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + - e); - System.exit(1); - } - } - public static void main(String[] args) { // TODO Auto-generated method stub //! [Interesting] @@ -79,4 +67,4 @@ public class GroveMQ3 { //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/GroveMQ9.java b/examples/java/GroveMQ9.java index f2a7e74d..24b916d5 100644 --- a/examples/java/GroveMQ9.java +++ b/examples/java/GroveMQ9.java @@ -36,18 +36,6 @@ import upm_gas.thresholdContext; public class GroveMQ9 { - static { - try { - System.loadLibrary("javaupm_gas"); - System.loadLibrary("mraajava"); - } catch (UnsatisfiedLinkError e) { - System.err.println( - "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + - e); - System.exit(1); - } - } - public static void main(String[] args) { // TODO Auto-generated method stub //! [Interesting] @@ -79,4 +67,4 @@ public class GroveMQ9 { //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/GroveMoistureSample.java b/examples/java/GroveMoistureSample.java index 261b8b20..8fb32d6e 100644 --- a/examples/java/GroveMoistureSample.java +++ b/examples/java/GroveMoistureSample.java @@ -23,15 +23,6 @@ */ public class GroveMoistureSample { - static { - try { - System.loadLibrary("javaupm_grovemoisture"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String args[]) throws InterruptedException { // ! [Interesting] upm_grovemoisture.GroveMoisture gm = new upm_grovemoisture.GroveMoisture(1); diff --git a/examples/java/GroveO2Example.java b/examples/java/GroveO2Example.java index 562a2c21..fe22b80f 100644 --- a/examples/java/GroveO2Example.java +++ b/examples/java/GroveO2Example.java @@ -26,18 +26,6 @@ import upm_groveo2.GroveO2; public class GroveO2Example { - static { - try { - System.loadLibrary("javaupm_groveo2"); - System.loadLibrary("mraajava"); - } catch (UnsatisfiedLinkError e) { - System.err.println( - "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + - e); - System.exit(1); - } - } - public static void main(String[] args) { // TODO Auto-generated method stub //! [Interesting] @@ -55,4 +43,4 @@ public class GroveO2Example { } //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/GroveQTouch.java b/examples/java/GroveQTouch.java index 0de82d94..795e4ac7 100644 --- a/examples/java/GroveQTouch.java +++ b/examples/java/GroveQTouch.java @@ -26,18 +26,6 @@ import upm_at42qt1070.AT42QT1070; public class GroveQTouch { - static { - try { - System.loadLibrary("javaupm_at42qt1070"); - System.loadLibrary("mraajava"); - } catch (UnsatisfiedLinkError e) { - System.err.println( - "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + - e); - System.exit(1); - } - } - public static void main(String[] args) { // TODO Auto-generated method stub // Instantiating the Q Touch sensor on the I2C bus 0 diff --git a/examples/java/GroveRelaySample.java b/examples/java/GroveRelaySample.java index 2058a68b..56a044b9 100644 --- a/examples/java/GroveRelaySample.java +++ b/examples/java/GroveRelaySample.java @@ -23,15 +23,6 @@ */ public class GroveRelaySample { - static { - try { - System.loadLibrary("javaupm_grove"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Create the button object using UART diff --git a/examples/java/GroveRotarySample.java b/examples/java/GroveRotarySample.java index 7918b863..f1b98c74 100644 --- a/examples/java/GroveRotarySample.java +++ b/examples/java/GroveRotarySample.java @@ -24,15 +24,6 @@ public class GroveRotarySample { - static { - try { - System.loadLibrary("javaupm_grove"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_grove.GroveRotary knob = new upm_grove.GroveRotary(0); diff --git a/examples/java/GroveSlideSample.java b/examples/java/GroveSlideSample.java index c689dac3..b1597130 100644 --- a/examples/java/GroveSlideSample.java +++ b/examples/java/GroveSlideSample.java @@ -23,15 +23,6 @@ */ public class GroveSlideSample { - static { - try { - System.loadLibrary("javaupm_grove"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main (String args[]) throws InterruptedException { //! [Interesting] // Instantiate new grove slide potentiometer on analog pin A0 diff --git a/examples/java/GroveSpeakerSample.java b/examples/java/GroveSpeakerSample.java index 4cee32d2..2e96c893 100644 --- a/examples/java/GroveSpeakerSample.java +++ b/examples/java/GroveSpeakerSample.java @@ -24,15 +24,6 @@ public class GroveSpeakerSample { - static { - try { - System.loadLibrary("javaupm_grovespeaker"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a Grove Speaker on digital pin D2 diff --git a/examples/java/GroveTempSample.java b/examples/java/GroveTempSample.java index 15bfe3f6..68788273 100644 --- a/examples/java/GroveTempSample.java +++ b/examples/java/GroveTempSample.java @@ -23,15 +23,6 @@ */ public class GroveTempSample { - static { - try { - System.loadLibrary("javaupm_grove"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main (String args[]) throws InterruptedException { //! [Interesting] upm_grove.GroveTemp temp = new upm_grove.GroveTemp(3); diff --git a/examples/java/GroveVDivSample.java b/examples/java/GroveVDivSample.java index aa0ed62b..579f2c3b 100644 --- a/examples/java/GroveVDivSample.java +++ b/examples/java/GroveVDivSample.java @@ -27,15 +27,6 @@ public class GroveVDivSample { private static final short gain3 = 3; private static final short gain10 = 10; - static { - try { - System.loadLibrary("javaupm_grovevdiv"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a Grove Voltage Divider sensor on analog pin A0 diff --git a/examples/java/GroveWFSSample.java b/examples/java/GroveWFSSample.java index 6545c434..5ab4997e 100644 --- a/examples/java/GroveWFSSample.java +++ b/examples/java/GroveWFSSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class GroveWFSSample { - static { - try { - System.loadLibrary("javaupm_grovewfs"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a Grove Water Flow Sensor on digital pin D2 diff --git a/examples/java/GroveWaterSample.java b/examples/java/GroveWaterSample.java index 2e382e5b..f275df77 100644 --- a/examples/java/GroveWaterSample.java +++ b/examples/java/GroveWaterSample.java @@ -24,15 +24,6 @@ public class GroveWaterSample { - static { - try { - System.loadLibrary("javaupm_grovewater"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a Grove Water sensor on digital pin D2 diff --git a/examples/java/H3LIS331DLSample.java b/examples/java/H3LIS331DLSample.java index 4cbe850c..ee1db398 100644 --- a/examples/java/H3LIS331DLSample.java +++ b/examples/java/H3LIS331DLSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class H3LIS331DLSample { - static { - try { - System.loadLibrary("javaupm_h3lis331dl"); - }catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { //! [Interesting] int[] val; diff --git a/examples/java/HCSR04Sample.java b/examples/java/HCSR04Sample.java index 1c3cf213..ee90773a 100644 --- a/examples/java/HCSR04Sample.java +++ b/examples/java/HCSR04Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class HCSR04Sample { - static { - try { - System.loadLibrary("javaupm_hcsr04"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - // ! [Interesting] public static void main(String[] args) throws InterruptedException { upm_hcsr04.HCSR04 sonar = new upm_hcsr04.HCSR04((short) 5, (short) 6); diff --git a/examples/java/HM11Sample.java b/examples/java/HM11Sample.java index f90d28a9..b37ae216 100644 --- a/examples/java/HM11Sample.java +++ b/examples/java/HM11Sample.java @@ -27,15 +27,6 @@ public class HM11Sample { private static final int BUFSIZ = 1024; - static { - try { - System.loadLibrary("javaupm_hm11"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - private static void printUsage() { System.out.println("Usage: java HM11Sample [AT command]"); diff --git a/examples/java/HMTRPSample.java b/examples/java/HMTRPSample.java index 32a89fd7..a3d24bdb 100644 --- a/examples/java/HMTRPSample.java +++ b/examples/java/HMTRPSample.java @@ -27,15 +27,6 @@ public class HMTRPSample { static private final int bufferLength = 255; - static { - try { - System.loadLibrary("javaupm_hmtrp"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - private static void printUsage() { System.out.println("Usage:"); System.out.println("Pass a commandline argument (any argument) to this program"); diff --git a/examples/java/HP20xExample.java b/examples/java/HP20xExample.java index 00df5af5..80820314 100644 --- a/examples/java/HP20xExample.java +++ b/examples/java/HP20xExample.java @@ -26,18 +26,6 @@ import upm_hp20x.HP20X; public class HP20xExample { - static { - try { - System.loadLibrary("javaupm_hp20x"); - System.loadLibrary("mraajava"); - } catch (UnsatisfiedLinkError e) { - System.err.println( - "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + - e); - System.exit(1); - } - } - public static void main(String[] args) { // TODO Auto-generated method stub @@ -59,4 +47,4 @@ public class HP20xExample { } //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/HTU21DSample.java b/examples/java/HTU21DSample.java index a402d046..33ad1a2b 100644 --- a/examples/java/HTU21DSample.java +++ b/examples/java/HTU21DSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class HTU21DSample { - static { - try { - System.loadLibrary("javaupm_htu21d"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] float humidity = 0; diff --git a/examples/java/Hmc5883lSample.java b/examples/java/Hmc5883lSample.java index f987845c..c16439c0 100644 --- a/examples/java/Hmc5883lSample.java +++ b/examples/java/Hmc5883lSample.java @@ -24,15 +24,6 @@ public class Hmc5883lSample { - static { - try { - System.loadLibrary("javaupm_hmc5883l"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate on I2C diff --git a/examples/java/Itg3200Sample.java b/examples/java/Itg3200Sample.java index 57728365..9edaa923 100644 --- a/examples/java/Itg3200Sample.java +++ b/examples/java/Itg3200Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class Itg3200Sample { - static { - try { - System.loadLibrary("javaupm_itg3200"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] short[] rot; diff --git a/examples/java/Jhd1313m1Sample.java b/examples/java/Jhd1313m1Sample.java index 5145136c..db84426e 100644 --- a/examples/java/Jhd1313m1Sample.java +++ b/examples/java/Jhd1313m1Sample.java @@ -24,15 +24,6 @@ public class Jhd1313m1Sample { - static { - try { - System.loadLibrary("javaupm_i2clcd"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(0); diff --git a/examples/java/Jhd1313m1_lcdSample.java b/examples/java/Jhd1313m1_lcdSample.java index 26caf406..bda19946 100644 --- a/examples/java/Jhd1313m1_lcdSample.java +++ b/examples/java/Jhd1313m1_lcdSample.java @@ -24,15 +24,6 @@ public class Jhd1313m1_lcdSample{ - static { - try { - System.loadLibrary("javaupm_i2clcd"); - }catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { //! [Interesting] upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(1, 0x3E, 0x62); diff --git a/examples/java/Joystick12_exampleSample.java b/examples/java/Joystick12_exampleSample.java index 94cfaa2c..442d59c3 100644 --- a/examples/java/Joystick12_exampleSample.java +++ b/examples/java/Joystick12_exampleSample.java @@ -24,15 +24,6 @@ public class Joystick12_exampleSample { - static { - try { - System.loadLibrary("javaupm_joystick12"); - }catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { //! [Interesting] // Instantiate a joystick on analog pins A0 and A1 diff --git a/examples/java/LDT0028Sample.java b/examples/java/LDT0028Sample.java index 152d81ed..0d3970e2 100644 --- a/examples/java/LDT0028Sample.java +++ b/examples/java/LDT0028Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class LDT0028Sample { - static { - try { - System.loadLibrary("javaupm_ldt0028"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] diff --git a/examples/java/LSM303Sample.java b/examples/java/LSM303Sample.java index a5077781..3644e02f 100644 --- a/examples/java/LSM303Sample.java +++ b/examples/java/LSM303Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class LSM303Sample { - static { - try { - System.loadLibrary("javaupm_lsm303"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate LSM303 compass on I2C diff --git a/examples/java/Lcm1602_i2cSample.java b/examples/java/Lcm1602_i2cSample.java index 8b49744a..53b8ba43 100644 --- a/examples/java/Lcm1602_i2cSample.java +++ b/examples/java/Lcm1602_i2cSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class Lcm1602_i2cSample { - static { - try { - System.loadLibrary("javaupm_i2clcd"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_i2clcd.Lcm1602 lcd = new upm_i2clcd.Lcm1602(0, 0x27); diff --git a/examples/java/Lcm1602_parallelSample.java b/examples/java/Lcm1602_parallelSample.java index 69064a63..bafd620b 100644 --- a/examples/java/Lcm1602_parallelSample.java +++ b/examples/java/Lcm1602_parallelSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class Lcm1602_parallelSample { - static { - try { - System.loadLibrary("javaupm_i2clcd"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // LCD connection: diff --git a/examples/java/LoL_exampleSample.java b/examples/java/LoL_exampleSample.java index 1b95ff00..b6d2bf38 100644 --- a/examples/java/LoL_exampleSample.java +++ b/examples/java/LoL_exampleSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class LoL_exampleSample { - static { - try { - System.loadLibrary("javaupm_lol"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_lol.LoL sensor = new upm_lol.LoL(); diff --git a/examples/java/M24LR64ESample.java b/examples/java/M24LR64ESample.java index d9aa235d..a0152a15 100644 --- a/examples/java/M24LR64ESample.java +++ b/examples/java/M24LR64ESample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class M24LR64ESample { - static { - try { - System.loadLibrary("javaupm_m24lr64e"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate an M24LR64E on I2C bus 0 diff --git a/examples/java/MAX44000Sample.java b/examples/java/MAX44000Sample.java index 144d1fd0..67e7e03e 100644 --- a/examples/java/MAX44000Sample.java +++ b/examples/java/MAX44000Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class MAX44000Sample { - static { - try { - System.loadLibrary("javaupm_max44000"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_max44000.MAX44000 sensor = new upm_max44000.MAX44000(0); diff --git a/examples/java/MHZ16Sample.java b/examples/java/MHZ16Sample.java index 6c1e3ba6..9059a23e 100644 --- a/examples/java/MHZ16Sample.java +++ b/examples/java/MHZ16Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class MHZ16Sample { - static { - try { - System.loadLibrary("javaupm_mhz16"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a MHZ16 serial CO2 sensor on uart 0. diff --git a/examples/java/MMA7455Sample.java b/examples/java/MMA7455Sample.java index 98532e3b..08ee8973 100644 --- a/examples/java/MMA7455Sample.java +++ b/examples/java/MMA7455Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class MMA7455Sample { - static { - try { - System.loadLibrary("javaupm_mma7455"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_mma7455.MMA7455 sensor = new upm_mma7455.MMA7455(0); diff --git a/examples/java/MMA7660Sample.java b/examples/java/MMA7660Sample.java index 58be0884..77736e26 100644 --- a/examples/java/MMA7660Sample.java +++ b/examples/java/MMA7660Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class MMA7660Sample { - static { - try { - System.loadLibrary("javaupm_mma7660"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate an MMA7660 on I2C bus 0 diff --git a/examples/java/MPL3115A2Sample.java b/examples/java/MPL3115A2Sample.java index 46cfadb1..8f5b877b 100644 --- a/examples/java/MPL3115A2Sample.java +++ b/examples/java/MPL3115A2Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class MPL3115A2Sample { - static { - try { - System.loadLibrary("javaupm_mpl3115a2"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a MPL3115A2 sensor on I2C diff --git a/examples/java/MPR121Sample.java b/examples/java/MPR121Sample.java index bbf788d7..37128b1b 100644 --- a/examples/java/MPR121Sample.java +++ b/examples/java/MPR121Sample.java @@ -1,14 +1,5 @@ public class MPR121Sample { - static { - try { - System.loadLibrary("javaupm_mpr121"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - private static void printButtons(upm_mpr121.MPR121 touch) { boolean buttonPresed = false; diff --git a/examples/java/MPU9150Sample.java b/examples/java/MPU9150Sample.java index 35f9affc..a8de875a 100644 --- a/examples/java/MPU9150Sample.java +++ b/examples/java/MPU9150Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class MPU9150Sample { - static { - try { - System.loadLibrary("javaupm_mpu9150"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_mpu9150.MPU9150 sensor = new upm_mpu9150.MPU9150(); diff --git a/examples/java/MQ2Sample.java b/examples/java/MQ2Sample.java index 46a4bfcf..fbad70a2 100644 --- a/examples/java/MQ2Sample.java +++ b/examples/java/MQ2Sample.java @@ -26,15 +26,6 @@ public class MQ2Sample { private static final short resolution = 5; - static { - try { - System.loadLibrary("javaupm_gas"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] short[] buffer = new short[128]; diff --git a/examples/java/MQ303ASample.java b/examples/java/MQ303ASample.java index a11d9f3f..13365b41 100644 --- a/examples/java/MQ303ASample.java +++ b/examples/java/MQ303ASample.java @@ -24,15 +24,6 @@ public class MQ303ASample { - static { - try { - System.loadLibrary("javaupm_mq303a"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // Instantiate an mq303a sensor on analog pin A0 diff --git a/examples/java/MQ5Sample.java b/examples/java/MQ5Sample.java index 082697f9..c2ae23d3 100644 --- a/examples/java/MQ5Sample.java +++ b/examples/java/MQ5Sample.java @@ -25,15 +25,6 @@ public class MQ5Sample { private static final short resolution = 7; - static { - try { - System.loadLibrary("javaupm_gas"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] short[] buffer = new short[128]; diff --git a/examples/java/MY9221Sample.java b/examples/java/MY9221Sample.java index 0c390b7d..15fc6c02 100644 --- a/examples/java/MY9221Sample.java +++ b/examples/java/MY9221Sample.java @@ -24,15 +24,6 @@ public class MY9221Sample { - static { - try { - System.loadLibrary("javaupm_my9221"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9 upm_my9221.MY9221 bar = new upm_my9221.MY9221((short) 8, (short) 9); diff --git a/examples/java/MY9221_ledbarSample.java b/examples/java/MY9221_ledbarSample.java index 08a729c7..1eaa0580 100644 --- a/examples/java/MY9221_ledbarSample.java +++ b/examples/java/MY9221_ledbarSample.java @@ -24,15 +24,6 @@ public class MY9221_ledbarSample{ - static { - try { - System.loadLibrary("javaupm_my9221"); - }catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { //! [Interesting] // Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9 diff --git a/examples/java/MicrophoneSample.java b/examples/java/MicrophoneSample.java index 8b3d9434..d59fc323 100644 --- a/examples/java/MicrophoneSample.java +++ b/examples/java/MicrophoneSample.java @@ -24,15 +24,6 @@ public class MicrophoneSample { - static { - try { - System.loadLibrary("javaupm_mic"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] short[] buffer = new short[128]; diff --git a/examples/java/NRF24L01_receiverSample.java b/examples/java/NRF24L01_receiverSample.java index 631fb8a3..c5dc4819 100644 --- a/examples/java/NRF24L01_receiverSample.java +++ b/examples/java/NRF24L01_receiverSample.java @@ -31,15 +31,6 @@ public class NRF24L01_receiverSample { static private final byte[] broadcast_address = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; - static { - try { - System.loadLibrary("javaupm_nrf24l01"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_nrf24l01.NRF24L01 comm = new upm_nrf24l01.NRF24L01((short) 7, (short) 8); diff --git a/examples/java/NRF24L01_transmitterSample.java b/examples/java/NRF24L01_transmitterSample.java index e646351b..f2918f0b 100644 --- a/examples/java/NRF24L01_transmitterSample.java +++ b/examples/java/NRF24L01_transmitterSample.java @@ -32,15 +32,6 @@ public class NRF24L01_transmitterSample { static private byte[] tx_buffer = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x00}; - static { - try { - System.loadLibrary("javaupm_nrf24l01"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_nrf24l01.NRF24L01 comm = new upm_nrf24l01.NRF24L01((short) 7, (short) 8); diff --git a/examples/java/NUNCHUCKSample.java b/examples/java/NUNCHUCKSample.java index a4d3c139..0a26d997 100644 --- a/examples/java/NUNCHUCKSample.java +++ b/examples/java/NUNCHUCKSample.java @@ -24,15 +24,6 @@ public class NUNCHUCKSample { - static { - try { - System.loadLibrary("javaupm_nunchuck"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a nunchuck controller bus 0 diff --git a/examples/java/OTP538USample.java b/examples/java/OTP538USample.java index be9ce150..07b3ba9b 100644 --- a/examples/java/OTP538USample.java +++ b/examples/java/OTP538USample.java @@ -25,15 +25,6 @@ public class OTP538USample { private static final float OTP538U_AREF = 5; - static { - try { - System.loadLibrary("javaupm_otp538u"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a OTP538U on analog pins A0 and A1 diff --git a/examples/java/PPD42NSSample.java b/examples/java/PPD42NSSample.java index d543f1ac..78d06280 100644 --- a/examples/java/PPD42NSSample.java +++ b/examples/java/PPD42NSSample.java @@ -24,15 +24,6 @@ public class PPD42NSSample { - static { - try { - System.loadLibrary("javaupm_ppd42ns"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a dust sensor on GPIO pin D8 diff --git a/examples/java/PulsensorSample.java b/examples/java/PulsensorSample.java index 6b779612..fb1e85b1 100644 --- a/examples/java/PulsensorSample.java +++ b/examples/java/PulsensorSample.java @@ -25,15 +25,6 @@ import upm_pulsensor.*; public class PulsensorSample { - static { - try { - System.loadLibrary("javaupm_pulsensor"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - static class PulsensorCallback extends Callback { public PulsensorCallback() { super(); diff --git a/examples/java/RFR359FSample.java b/examples/java/RFR359FSample.java index 869820e3..0c286de2 100644 --- a/examples/java/RFR359FSample.java +++ b/examples/java/RFR359FSample.java @@ -24,15 +24,6 @@ public class RFR359FSample { - static { - try { - System.loadLibrary("javaupm_rfr359f"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate an RFR359F digital pin D2 diff --git a/examples/java/RPR220Sample.java b/examples/java/RPR220Sample.java index 4318c4ae..ae76be6d 100644 --- a/examples/java/RPR220Sample.java +++ b/examples/java/RPR220Sample.java @@ -24,15 +24,6 @@ public class RPR220Sample { - static { - try { - System.loadLibrary("javaupm_rpr220"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // This example uses a simple method to determine current status diff --git a/examples/java/RPR220_intrSample.java b/examples/java/RPR220_intrSample.java index 5d72d4ac..84f844c5 100644 --- a/examples/java/RPR220_intrSample.java +++ b/examples/java/RPR220_intrSample.java @@ -28,15 +28,6 @@ public class RPR220_intrSample { public static int counter = 0; - static { - try { - System.loadLibrary("javaupm_rpr220"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // This example uses an interrupt handler to increment a counter diff --git a/examples/java/RotaryEncoderSample.java b/examples/java/RotaryEncoderSample.java index 7f5d6f48..8272f573 100644 --- a/examples/java/RotaryEncoderSample.java +++ b/examples/java/RotaryEncoderSample.java @@ -24,15 +24,6 @@ public class RotaryEncoderSample { - static { - try { - System.loadLibrary("javaupm_rotaryencoder"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a Grove Rotary Encoder, using signal pins D2 and D3 diff --git a/examples/java/SSD1308_oledSample.java b/examples/java/SSD1308_oledSample.java index b74b62b6..c7a5bd30 100644 --- a/examples/java/SSD1308_oledSample.java +++ b/examples/java/SSD1308_oledSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class SSD1308_oledSample { - static { - try { - System.loadLibrary("javaupm_i2clcd"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - static private final int[] IntelLogo = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 192, 192, 192, 224, 224, 224, 224, 240, 240, 248, 248, 120, 120, 120, 120, 60, 60, 60, 60, diff --git a/examples/java/SSD1327_oledSample.java b/examples/java/SSD1327_oledSample.java index bc7e984f..defeea62 100644 --- a/examples/java/SSD1327_oledSample.java +++ b/examples/java/SSD1327_oledSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class SSD1327_oledSample { - static { - try { - System.loadLibrary("javaupm_i2clcd"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - static private final int[] SeeedLogo = new int[]{0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, 0x00, 0x00, 0x00, 0x00, diff --git a/examples/java/ST7735Sample.java b/examples/java/ST7735Sample.java index 1cd50b11..a866e987 100644 --- a/examples/java/ST7735Sample.java +++ b/examples/java/ST7735Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class ST7735Sample { - static { - try { - System.loadLibrary("javaupm_st7735"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_st7735.ST7735 lcd = new upm_st7735.ST7735((short) 7, (short) 4, (short) 9, (short) 8); diff --git a/examples/java/StepMotorSample.java b/examples/java/StepMotorSample.java index 6dee3a21..ebe59a06 100644 --- a/examples/java/StepMotorSample.java +++ b/examples/java/StepMotorSample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class StepMotorSample { - static { - try { - System.loadLibrary("javaupm_stepmotor"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_stepmotor.StepMotor sensor = new upm_stepmotor.StepMotor(4, 6); diff --git a/examples/java/TM1637Sample.java b/examples/java/TM1637Sample.java index 2caf66df..840b9690 100644 --- a/examples/java/TM1637Sample.java +++ b/examples/java/TM1637Sample.java @@ -27,15 +27,6 @@ import java.time.LocalDateTime; //NOT TESTED!!! public class TM1637Sample { - static { - try { - System.loadLibrary("javaupm_tm1637"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // TM1637 on pins 0 (clk) and 1 (dio) diff --git a/examples/java/TP401Sample.java b/examples/java/TP401Sample.java index 2f815181..89ac2b13 100644 --- a/examples/java/TP401Sample.java +++ b/examples/java/TP401Sample.java @@ -23,15 +23,6 @@ */ public class TP401Sample { - static { - try { - System.loadLibrary("javaupm_gas"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - private static String airQuality(int value) { if (value < 50) return "Fresh Air"; diff --git a/examples/java/TSL2561Sample.java b/examples/java/TSL2561Sample.java index 999aaaa8..d3664465 100644 --- a/examples/java/TSL2561Sample.java +++ b/examples/java/TSL2561Sample.java @@ -24,15 +24,6 @@ public class TSL2561Sample { - static { - try { - System.loadLibrary("javaupm_tsl2561"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a TSL2561 Digital Light Sensor on I2C diff --git a/examples/java/TTP223Sample.java b/examples/java/TTP223Sample.java index a6c90754..394efb53 100644 --- a/examples/java/TTP223Sample.java +++ b/examples/java/TTP223Sample.java @@ -24,15 +24,6 @@ public class TTP223Sample { - static { - try { - System.loadLibrary("javaupm_ttp223"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] upm_ttp223.TTP223 touch = new upm_ttp223.TTP223(7); diff --git a/examples/java/ULN200XASample.java b/examples/java/ULN200XASample.java index ee89f926..81f97ad6 100644 --- a/examples/java/ULN200XASample.java +++ b/examples/java/ULN200XASample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class ULN200XASample { - static { - try { - System.loadLibrary("javaupm_uln200xa"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a Stepper motor on a ULN200XA Dual H-Bridge. diff --git a/examples/java/Ublox6Sample.java b/examples/java/Ublox6Sample.java index f5f8eb2a..b7c5017f 100644 --- a/examples/java/Ublox6Sample.java +++ b/examples/java/Ublox6Sample.java @@ -25,15 +25,6 @@ public class Ublox6Sample { private static final int BUFFERLENGTH = 256; - static { - try { - System.loadLibrary("javaupm_ublox6"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a Ublox6 GPS device on uart 0 diff --git a/examples/java/WT5001Sample.java b/examples/java/WT5001Sample.java index 2a02d8d1..2266b3dd 100644 --- a/examples/java/WT5001Sample.java +++ b/examples/java/WT5001Sample.java @@ -27,15 +27,6 @@ import java.io.IOException; //NOT TESTED!!! public class WT5001Sample { - static { - try { - System.loadLibrary("javaupm_wt5001"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - static private void printUsage() { System.out.println("Usage: java WT5001Sample "); System.out.println("Commands:"); diff --git a/examples/java/WaterLevelSensor.java b/examples/java/WaterLevelSensor.java index 51075315..d08aaee3 100644 --- a/examples/java/WaterLevelSensor.java +++ b/examples/java/WaterLevelSensor.java @@ -26,18 +26,6 @@ import upm_waterlevel.WaterLevel; public class WaterLevelSensor { - static { - try { - System.loadLibrary("javaupm_waterlevel"); - System.loadLibrary("mraajava"); - } catch (UnsatisfiedLinkError e) { - System.err.println( - "Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + - e); - System.exit(1); - } - } - public static void main(String[] args) { // TODO Auto-generated method stub //! [Interesting] @@ -61,4 +49,4 @@ public class WaterLevelSensor { //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/YG1006Sample.java b/examples/java/YG1006Sample.java index fcb8dea2..b9948296 100644 --- a/examples/java/YG1006Sample.java +++ b/examples/java/YG1006Sample.java @@ -24,15 +24,6 @@ public class YG1006Sample { - static { - try { - System.loadLibrary("javaupm_yg1006"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a yg1006 flame sensor on digital pin D2 diff --git a/examples/java/ZFM20Sample.java b/examples/java/ZFM20Sample.java index dd337f2f..3a36b846 100644 --- a/examples/java/ZFM20Sample.java +++ b/examples/java/ZFM20Sample.java @@ -25,15 +25,6 @@ //NOT TESTED!!! public class ZFM20Sample { - static { - try { - System.loadLibrary("javaupm_zfm20"); - } catch (UnsatisfiedLinkError e) { - System.err.println("error in loading native library"); - System.exit(-1); - } - } - public static void main(String[] args) throws InterruptedException { // ! [Interesting] // Instantiate a ZFM20 Fingerprint reader on UART 0