Browse Source

java: removed loadLibrary preamble from examples

Signed-off-by: Stefan Andritoiu <stefan.andritoiu@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Stefan Andritoiu 9 years ago
parent
commit
9bf184129e
92 changed files with 9 additions and 868 deletions
  1. 0
    9
      examples/java/A110XSample.java
  2. 0
    9
      examples/java/A110X_intrSample.java
  3. 0
    9
      examples/java/ADC121C021Sample.java
  4. 0
    9
      examples/java/Adxl345Sample.java
  5. 1
    13
      examples/java/Apds9002.java
  6. 0
    9
      examples/java/BISS0001Sample.java
  7. 0
    9
      examples/java/BMPX8XSample.java
  8. 0
    9
      examples/java/BuzzerSample.java
  9. 0
    9
      examples/java/Buzzer_soundSample.java
  10. 0
    9
      examples/java/CJQ4435Sample.java
  11. 0
    9
      examples/java/DS1307Sample.java
  12. 0
    9
      examples/java/ENC03RSample.java
  13. 0
    9
      examples/java/ES08ASample.java
  14. 0
    9
      examples/java/GROVESCAMSample.java
  15. 0
    9
      examples/java/GUVAS12DSample.java
  16. 0
    9
      examples/java/GroveButton_intrSample.java
  17. 1
    14
      examples/java/GroveCollision.java
  18. 0
    9
      examples/java/GroveEHRSample.java
  19. 1
    13
      examples/java/GroveEmg.java
  20. 1
    13
      examples/java/GroveGsr.java
  21. 0
    9
      examples/java/GroveLEDSample.java
  22. 0
    9
      examples/java/GroveLed_multiSample.java
  23. 0
    9
      examples/java/GroveLightSample.java
  24. 0
    9
      examples/java/GroveLineFinderSample.java
  25. 0
    9
      examples/java/GroveMDSample.java
  26. 1
    13
      examples/java/GroveMQ3.java
  27. 1
    13
      examples/java/GroveMQ9.java
  28. 0
    9
      examples/java/GroveMoistureSample.java
  29. 1
    13
      examples/java/GroveO2Example.java
  30. 0
    12
      examples/java/GroveQTouch.java
  31. 0
    9
      examples/java/GroveRelaySample.java
  32. 0
    9
      examples/java/GroveRotarySample.java
  33. 0
    9
      examples/java/GroveSlideSample.java
  34. 0
    9
      examples/java/GroveSpeakerSample.java
  35. 0
    9
      examples/java/GroveTempSample.java
  36. 0
    9
      examples/java/GroveVDivSample.java
  37. 0
    9
      examples/java/GroveWFSSample.java
  38. 0
    9
      examples/java/GroveWaterSample.java
  39. 0
    9
      examples/java/H3LIS331DLSample.java
  40. 0
    9
      examples/java/HCSR04Sample.java
  41. 0
    9
      examples/java/HM11Sample.java
  42. 0
    9
      examples/java/HMTRPSample.java
  43. 1
    13
      examples/java/HP20xExample.java
  44. 0
    9
      examples/java/HTU21DSample.java
  45. 0
    9
      examples/java/Hmc5883lSample.java
  46. 0
    9
      examples/java/Itg3200Sample.java
  47. 0
    9
      examples/java/Jhd1313m1Sample.java
  48. 0
    9
      examples/java/Jhd1313m1_lcdSample.java
  49. 0
    9
      examples/java/Joystick12_exampleSample.java
  50. 0
    9
      examples/java/LDT0028Sample.java
  51. 0
    9
      examples/java/LSM303Sample.java
  52. 0
    9
      examples/java/Lcm1602_i2cSample.java
  53. 0
    9
      examples/java/Lcm1602_parallelSample.java
  54. 0
    9
      examples/java/LoL_exampleSample.java
  55. 0
    9
      examples/java/M24LR64ESample.java
  56. 0
    9
      examples/java/MAX44000Sample.java
  57. 0
    9
      examples/java/MHZ16Sample.java
  58. 0
    9
      examples/java/MMA7455Sample.java
  59. 0
    9
      examples/java/MMA7660Sample.java
  60. 0
    9
      examples/java/MPL3115A2Sample.java
  61. 0
    9
      examples/java/MPR121Sample.java
  62. 0
    9
      examples/java/MPU9150Sample.java
  63. 0
    9
      examples/java/MQ2Sample.java
  64. 0
    9
      examples/java/MQ303ASample.java
  65. 0
    9
      examples/java/MQ5Sample.java
  66. 0
    9
      examples/java/MY9221Sample.java
  67. 0
    9
      examples/java/MY9221_ledbarSample.java
  68. 0
    9
      examples/java/MicrophoneSample.java
  69. 0
    9
      examples/java/NRF24L01_receiverSample.java
  70. 0
    9
      examples/java/NRF24L01_transmitterSample.java
  71. 0
    9
      examples/java/NUNCHUCKSample.java
  72. 0
    9
      examples/java/OTP538USample.java
  73. 0
    9
      examples/java/PPD42NSSample.java
  74. 0
    9
      examples/java/PulsensorSample.java
  75. 0
    9
      examples/java/RFR359FSample.java
  76. 0
    9
      examples/java/RPR220Sample.java
  77. 0
    9
      examples/java/RPR220_intrSample.java
  78. 0
    9
      examples/java/RotaryEncoderSample.java
  79. 0
    9
      examples/java/SSD1308_oledSample.java
  80. 0
    9
      examples/java/SSD1327_oledSample.java
  81. 0
    9
      examples/java/ST7735Sample.java
  82. 0
    9
      examples/java/StepMotorSample.java
  83. 0
    9
      examples/java/TM1637Sample.java
  84. 0
    9
      examples/java/TP401Sample.java
  85. 0
    9
      examples/java/TSL2561Sample.java
  86. 0
    9
      examples/java/TTP223Sample.java
  87. 0
    9
      examples/java/ULN200XASample.java
  88. 0
    9
      examples/java/Ublox6Sample.java
  89. 0
    9
      examples/java/WT5001Sample.java
  90. 1
    13
      examples/java/WaterLevelSensor.java
  91. 0
    9
      examples/java/YG1006Sample.java
  92. 0
    9
      examples/java/ZFM20Sample.java

+ 0
- 9
examples/java/A110XSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class A110XSample {
26 26
 	
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_a110x");
30
-		}catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-	
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		//! [Interesting]
38 29
 		// Instantiate an A110X sensor on digital pin D2

+ 0
- 9
examples/java/A110X_intrSample.java View File

@@ -28,15 +28,6 @@ public class A110X_intrSample {
28 28
 	
29 29
 	public static int counter=0;
30 30
 		
31
-	static {
32
-		try {
33
-			System.loadLibrary("javaupm_a110x");
34
-		}catch (UnsatisfiedLinkError e) {
35
-			System.err.println("error in loading native library");
36
-			System.exit(-1);
37
-		}
38
-	}
39
-
40 31
 	public static void main(String[] args) throws InterruptedException {
41 32
 		//! [Interesting]
42 33
 		// Instantiate an A110X sensor on digital pin D2

+ 0
- 9
examples/java/ADC121C021Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class ADC121C021Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_adc121c021");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate an ADC121C021 on I2C bus 0

+ 0
- 9
examples/java/Adxl345Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class Adxl345Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_adxl345");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		short[] val;

+ 1
- 13
examples/java/Apds9002.java View File

@@ -26,18 +26,6 @@ import upm_apds9002.APDS9002;
26 26
 
27 27
 public class Apds9002 {
28 28
 
29
-	static {
30
-		try {
31
-			System.loadLibrary("javaupm_apds9002");
32
-			System.loadLibrary("mraajava");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println(
35
-					"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
36
-							e);
37
-			System.exit(1);
38
-		}
39
-	}
40
-
41 29
 	public static void main(String[] args) {
42 30
 		// TODO Auto-generated method stub
43 31
 		//! [Interesting]
@@ -56,4 +44,4 @@ public class Apds9002 {
56 44
 		//! [Interesting]
57 45
 	}
58 46
 
59
-}
47
+}

+ 0
- 9
examples/java/BISS0001Sample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class BISS0001Sample{
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_biss0001");
30
-		}catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-	
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 //! [Interesting]
38 29
         // Instantiate a Grove Motion sensor on GPIO pin D7

+ 0
- 9
examples/java/BMPX8XSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class BMPX8XSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_bmpx8x");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate a BMPX8X sensor on I2C

+ 0
- 9
examples/java/BuzzerSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class BuzzerSample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_buzzer");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		int chord[] = {

+ 0
- 9
examples/java/Buzzer_soundSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class Buzzer_soundSample {
26 26
 	
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_buzzer");
30
-		}catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-	
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
         //! [Interesting]
38 29
 		int chord[] = {

+ 0
- 9
examples/java/CJQ4435Sample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class CJQ4435Sample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_cjq4435");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// Instantiate a CJQ4435 MOSFET on a PWM capable digital pin D3
38 29
 		upm_cjq4435.CJQ4435 mosfet = new upm_cjq4435.CJQ4435(3);

+ 0
- 9
examples/java/DS1307Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class DS1307Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_ds1307");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	static private void printTime(upm_ds1307.DS1307 rtc) {
38 29
 		System.out.print("The time is: " + rtc.getMonth() + "/" + rtc.getDayOfMonth() + "/"
39 30
 				+ rtc.getYear() + " " + rtc.getHours() + ":" + rtc.getMinutes() + ":"

+ 0
- 9
examples/java/ENC03RSample.java View File

@@ -26,15 +26,6 @@
26 26
 public class ENC03RSample {
27 27
 	private static final long CALIBRATION_SAMPLES = 1000;
28 28
 
29
-	static {
30
-		try {
31
-			System.loadLibrary("javaupm_enc03r");
32
-		} catch (UnsatisfiedLinkError e) {
33
-			System.err.println("error in loading native library");
34
-			System.exit(-1);
35
-		}
36
-	}
37
-
38 29
 	public static void main(String[] args) throws InterruptedException {
39 30
 		// ! [Interesting]
40 31
 

+ 0
- 9
examples/java/ES08ASample.java View File

@@ -23,15 +23,6 @@
23 23
  */
24 24
 
25 25
 public class ES08ASample {
26
-	static {
27
-		try {
28
-			System.loadLibrary("javaupm_servo");
29
-		} catch (UnsatisfiedLinkError e) {
30
-			System.err.println("error in loading native library");
31
-			System.exit(-1);
32
-		}
33
-	}
34
-
35 26
 	public static void main(String[] args) throws InterruptedException {
36 27
 		// ! [Interesting]
37 28
 		upm_servo.ES08A servo = new upm_servo.ES08A(6);

+ 0
- 9
examples/java/GROVESCAMSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class GROVESCAMSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_grovescam");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate a Grove Serial Camera on UART 0

+ 0
- 9
examples/java/GUVAS12DSample.java View File

@@ -27,15 +27,6 @@ public class GUVAS12DSample {
27 27
 	private static final float GUVAS12D_AREF = 5;
28 28
 	private static final int SAMPLES_PER_QUERY = 1024;
29 29
 
30
-	static {
31
-		try {
32
-			System.loadLibrary("javaupm_guvas12d");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println("error in loading native library");
35
-			System.exit(-1);
36
-		}
37
-	}
38
-
39 30
 	public static void main(String[] args) throws InterruptedException {
40 31
 		// ! [Interesting]
41 32
 		// Instantiate a GUVAS12D on analog pin A3

+ 0
- 9
examples/java/GroveButton_intrSample.java View File

@@ -29,15 +29,6 @@ public class GroveButton_intrSample {
29 29
 
30 30
 	public static int counter = 0;
31 31
 
32
-	static {
33
-		try {
34
-			System.loadLibrary("mraajava");
35
-		} catch (UnsatisfiedLinkError e) {
36
-			System.err.println("error in loading native library");
37
-			System.exit(-1);
38
-		}
39
-	}
40
-
41 32
 	public static void main(String[] args) throws InterruptedException {
42 33
 		// ! [Interesting]
43 34
 		upm_grove.GroveButton b = new upm_grove.GroveButton(2);

+ 1
- 14
examples/java/GroveCollision.java View File

@@ -26,19 +26,6 @@ import upm_grovecollision.*;
26 26
 
27 27
 public class GroveCollision {
28 28
 
29
-	static boolean shouldRun = true;
30
-	static {
31
-		try {
32
-			System.loadLibrary("javaupm_grovecollision");
33
-			System.loadLibrary("mraajava");
34
-		} catch (UnsatisfiedLinkError e) {
35
-			System.err.println(
36
-					"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
37
-							e);
38
-			System.exit(1);
39
-		}
40
-	}
41
-
42 29
 	public static void main(String[] args) {
43 30
 		// TODO Auto-generated method stub
44 31
 		// Initializing the sensor on D2 on the Base Shield
@@ -60,4 +47,4 @@ public class GroveCollision {
60 47
 		System.out.println("Exiting");
61 48
 	}
62 49
 
63
-}
50
+}

+ 0
- 9
examples/java/GroveEHRSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class GroveEHRSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_groveehr");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate a Grove Ear-clip Heart Rate sensor on digital pin D2

+ 1
- 13
examples/java/GroveEmg.java View File

@@ -25,18 +25,6 @@ import upm_groveemg.GroveEMG;
25 25
 
26 26
 public class GroveEmg {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_groveemg");
31
-			System.loadLibrary("mraajava");
32
-		} catch (UnsatisfiedLinkError e) {
33
-			System.err.println(
34
-					"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
35
-							e);
36
-			System.exit(1);
37
-		}
38
-	}
39
-
40 28
 	public static void main(String[] args) {
41 29
 		// TODO Auto-generated method stub
42 30
 		//! [Interesting]
@@ -56,4 +44,4 @@ public class GroveEmg {
56 44
 		}
57 45
 	}
58 46
 	//! [Interesting]
59
-}
47
+}

+ 1
- 13
examples/java/GroveGsr.java View File

@@ -26,18 +26,6 @@ import upm_grovegsr.GroveGSR;
26 26
 
27 27
 public class GroveGsr {
28 28
 
29
-	static {
30
-		try {
31
-			System.loadLibrary("javaupm_grovegsr");
32
-			System.loadLibrary("mraajava");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println(
35
-					"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
36
-							e);
37
-			System.exit(1);
38
-		}
39
-	}
40
-
41 29
 	public static void main(String[] args) {
42 30
 		// TODO Auto-generated method stub
43 31
 
@@ -59,4 +47,4 @@ public class GroveGsr {
59 47
 		//! [Interesting]
60 48
 	}
61 49
 
62
-}
50
+}

+ 0
- 9
examples/java/GroveLEDSample.java View File

@@ -23,15 +23,6 @@
23 23
  */
24 24
 
25 25
 public class GroveLEDSample {
26
-	static {
27
-		try {
28
-			System.loadLibrary("javaupm_grove");
29
-		} catch (UnsatisfiedLinkError e) {
30
-			System.err.println("error in loading native library");
31
-			System.exit(-1);
32
-		}
33
-	}
34
-
35 26
 	public static void main (String args[]) throws InterruptedException {
36 27
 		//! [Interesting]
37 28
         upm_grove.GroveLed led = new upm_grove.GroveLed(2);

+ 0
- 9
examples/java/GroveLed_multiSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class GroveLed_multiSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_grove");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate a grove LED on D2. Here we are controlling a Grove

+ 0
- 9
examples/java/GroveLightSample.java View File

@@ -23,15 +23,6 @@
23 23
  */
24 24
 
25 25
 public class GroveLightSample {
26
-	static {
27
-		try {
28
-			System.loadLibrary("javaupm_grove");
29
-		} catch (UnsatisfiedLinkError e) {
30
-			System.err.println("error in loading native library");
31
-			System.exit(-1);
32
-		}
33
-	}
34
-
35 26
 	public static void main(String args[]) throws InterruptedException {
36 27
 		// ! [Interesting]
37 28
 		upm_grove.GroveLight gl = new upm_grove.GroveLight(2);

+ 0
- 9
examples/java/GroveLineFinderSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class GroveLineFinderSample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_grovelinefinder");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		// Instantiate a Grove Line Finder sensor on digital pin D2

+ 0
- 9
examples/java/GroveMDSample.java View File

@@ -26,15 +26,6 @@ public class GroveMDSample {
26 26
 	private static final short speed50 = 127;
27 27
 	private static final short speed0 = 0;
28 28
 
29
-	static {
30
-		try {
31
-			System.loadLibrary("javaupm_grovemd");
32
-		} catch (UnsatisfiedLinkError e) {
33
-			System.err.println("error in loading native library");
34
-			System.exit(-1);
35
-		}
36
-	}
37
-
38 29
 	public static void main(String[] args) throws InterruptedException {
39 30
 		// ! [Interesting]
40 31
 		// Instantiate an I2C Grove Motor Driver on I2C bus 0

+ 1
- 13
examples/java/GroveMQ3.java View File

@@ -36,18 +36,6 @@ import upm_gas.thresholdContext;
36 36
 
37 37
 public class GroveMQ3 {
38 38
 
39
-	static {
40
-		try {
41
-			System.loadLibrary("javaupm_gas");
42
-			System.loadLibrary("mraajava");
43
-		} catch (UnsatisfiedLinkError e) {
44
-			System.err.println(
45
-					"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
46
-							e);
47
-			System.exit(1);
48
-		}
49
-	}
50
-
51 39
 	public static void main(String[] args) {
52 40
 		// TODO Auto-generated method stub
53 41
 		//! [Interesting]
@@ -79,4 +67,4 @@ public class GroveMQ3 {
79 67
 		//! [Interesting]
80 68
 	}
81 69
 
82
-}
70
+}

+ 1
- 13
examples/java/GroveMQ9.java View File

@@ -36,18 +36,6 @@ import upm_gas.thresholdContext;
36 36
 
37 37
 public class GroveMQ9 {
38 38
 
39
-	static {
40
-		try {
41
-			System.loadLibrary("javaupm_gas");
42
-			System.loadLibrary("mraajava");
43
-		} catch (UnsatisfiedLinkError e) {
44
-			System.err.println(
45
-					"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
46
-							e);
47
-			System.exit(1);
48
-		}
49
-	}
50
-
51 39
 	public static void main(String[] args) {
52 40
 		// TODO Auto-generated method stub
53 41
 		//! [Interesting]
@@ -79,4 +67,4 @@ public class GroveMQ9 {
79 67
 		//! [Interesting]
80 68
 	}
81 69
 
82
-}
70
+}

+ 0
- 9
examples/java/GroveMoistureSample.java View File

@@ -23,15 +23,6 @@
23 23
  */
24 24
 
25 25
 public class GroveMoistureSample {
26
-	static {
27
-		try {
28
-			System.loadLibrary("javaupm_grovemoisture");
29
-		} catch (UnsatisfiedLinkError e) {
30
-			System.err.println("error in loading native library");
31
-			System.exit(-1);
32
-		}
33
-	}
34
-
35 26
 	public static void main(String args[]) throws InterruptedException {
36 27
 		// ! [Interesting]
37 28
 		upm_grovemoisture.GroveMoisture gm = new upm_grovemoisture.GroveMoisture(1);

+ 1
- 13
examples/java/GroveO2Example.java View File

@@ -26,18 +26,6 @@ import upm_groveo2.GroveO2;
26 26
 
27 27
 public class GroveO2Example {
28 28
 
29
-	static {
30
-		try {
31
-			System.loadLibrary("javaupm_groveo2");
32
-			System.loadLibrary("mraajava");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println(
35
-					"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
36
-							e);
37
-			System.exit(1);
38
-		}
39
-	}
40
-
41 29
 	public static void main(String[] args) {
42 30
 		// TODO Auto-generated method stub
43 31
 		//! [Interesting]
@@ -55,4 +43,4 @@ public class GroveO2Example {
55 43
 		}
56 44
 		//! [Interesting]
57 45
 	}
58
-}
46
+}

+ 0
- 12
examples/java/GroveQTouch.java View File

@@ -26,18 +26,6 @@ import upm_at42qt1070.AT42QT1070;
26 26
 
27 27
 public class GroveQTouch {
28 28
 
29
-	static {
30
-		try {
31
-			System.loadLibrary("javaupm_at42qt1070");
32
-			System.loadLibrary("mraajava");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println(
35
-					"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
36
-							e);
37
-			System.exit(1);
38
-		}
39
-	}
40
-
41 29
 	public static void main(String[] args) {
42 30
 		// TODO Auto-generated method stub
43 31
 		// Instantiating the Q Touch sensor on the I2C bus 0

+ 0
- 9
examples/java/GroveRelaySample.java View File

@@ -23,15 +23,6 @@
23 23
  */
24 24
 
25 25
 public class GroveRelaySample {
26
-	static {
27
-		try {
28
-			System.loadLibrary("javaupm_grove");
29
-		} catch (UnsatisfiedLinkError e) {
30
-			System.err.println("error in loading native library");
31
-			System.exit(-1);
32
-		}
33
-	}
34
-
35 26
 	public static void main(String[] args) throws InterruptedException {
36 27
 		// ! [Interesting]
37 28
 		// Create the button object using UART

+ 0
- 9
examples/java/GroveRotarySample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class GroveRotarySample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_grove");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		upm_grove.GroveRotary knob = new upm_grove.GroveRotary(0);

+ 0
- 9
examples/java/GroveSlideSample.java View File

@@ -23,15 +23,6 @@
23 23
  */
24 24
 
25 25
 public class GroveSlideSample {
26
-	static {
27
-		try {
28
-			System.loadLibrary("javaupm_grove");
29
-		} catch (UnsatisfiedLinkError e) {
30
-			System.err.println("error in loading native library");
31
-			System.exit(-1);
32
-		}
33
-	}
34
-
35 26
 	public static void main (String args[]) throws InterruptedException {
36 27
 		//! [Interesting]
37 28
         // Instantiate new grove slide potentiometer on  analog pin A0

+ 0
- 9
examples/java/GroveSpeakerSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class GroveSpeakerSample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_grovespeaker");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		// Instantiate a Grove Speaker on digital pin D2

+ 0
- 9
examples/java/GroveTempSample.java View File

@@ -23,15 +23,6 @@
23 23
  */
24 24
 
25 25
 public class GroveTempSample {
26
-	static {
27
-		try {
28
-			System.loadLibrary("javaupm_grove");
29
-		} catch (UnsatisfiedLinkError e) {
30
-			System.err.println("error in loading native library");
31
-			System.exit(-1);
32
-		}
33
-	}
34
-
35 26
 	public static void main (String args[]) throws InterruptedException {
36 27
 		//! [Interesting]
37 28
         upm_grove.GroveTemp temp = new upm_grove.GroveTemp(3);

+ 0
- 9
examples/java/GroveVDivSample.java View File

@@ -27,15 +27,6 @@ public class GroveVDivSample {
27 27
 	private static final short gain3 = 3;
28 28
 	private static final short gain10 = 10;
29 29
 
30
-	static {
31
-		try {
32
-			System.loadLibrary("javaupm_grovevdiv");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println("error in loading native library");
35
-			System.exit(-1);
36
-		}
37
-	}
38
-
39 30
 	public static void main(String[] args) throws InterruptedException {
40 31
 		// ! [Interesting]
41 32
 		// Instantiate a Grove Voltage Divider sensor on analog pin A0

+ 0
- 9
examples/java/GroveWFSSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class GroveWFSSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_grovewfs");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate a Grove Water Flow Sensor on digital pin D2

+ 0
- 9
examples/java/GroveWaterSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class GroveWaterSample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_grovewater");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		// Instantiate a Grove Water sensor on digital pin D2

+ 0
- 9
examples/java/H3LIS331DLSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class H3LIS331DLSample {
27 27
 	
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_h3lis331dl");
31
-		}catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-	
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		//! [Interesting]
39 30
 		int[] val;

+ 0
- 9
examples/java/HCSR04Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class HCSR04Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_hcsr04");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	// ! [Interesting]
38 29
 	public static void main(String[] args) throws InterruptedException {
39 30
 		upm_hcsr04.HCSR04 sonar = new upm_hcsr04.HCSR04((short) 5, (short) 6);

+ 0
- 9
examples/java/HM11Sample.java View File

@@ -27,15 +27,6 @@ public class HM11Sample {
27 27
 
28 28
 	private static final int BUFSIZ = 1024;
29 29
 
30
-	static {
31
-		try {
32
-			System.loadLibrary("javaupm_hm11");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println("error in loading native library");
35
-			System.exit(-1);
36
-		}
37
-	}
38
-
39 30
 	private static void printUsage() {
40 31
 		System.out.println("Usage: java HM11Sample [AT command]");
41 32
 

+ 0
- 9
examples/java/HMTRPSample.java View File

@@ -27,15 +27,6 @@ public class HMTRPSample {
27 27
 
28 28
 	static private final int bufferLength = 255;
29 29
 
30
-	static {
31
-		try {
32
-			System.loadLibrary("javaupm_hmtrp");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println("error in loading native library");
35
-			System.exit(-1);
36
-		}
37
-	}
38
-
39 30
 	private static void printUsage() {
40 31
 		System.out.println("Usage:");
41 32
 		System.out.println("Pass a commandline argument (any argument) to this program");

+ 1
- 13
examples/java/HP20xExample.java View File

@@ -26,18 +26,6 @@ import upm_hp20x.HP20X;
26 26
 
27 27
 public class HP20xExample {
28 28
 
29
-	static {
30
-		try {
31
-			System.loadLibrary("javaupm_hp20x");
32
-			System.loadLibrary("mraajava");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println(
35
-					"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
36
-							e);
37
-			System.exit(1);
38
-		}
39
-	}
40
-
41 29
 	public static void main(String[] args) {
42 30
 		// TODO Auto-generated method stub
43 31
 
@@ -59,4 +47,4 @@ public class HP20xExample {
59 47
 		}
60 48
 		//! [Interesting]
61 49
 	}
62
-}
50
+}

+ 0
- 9
examples/java/HTU21DSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class HTU21DSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_htu21d");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		float humidity = 0;

+ 0
- 9
examples/java/Hmc5883lSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class Hmc5883lSample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_hmc5883l");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		// Instantiate on I2C

+ 0
- 9
examples/java/Itg3200Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class Itg3200Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_itg3200");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		short[] rot;

+ 0
- 9
examples/java/Jhd1313m1Sample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class Jhd1313m1Sample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_i2clcd");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(0);

+ 0
- 9
examples/java/Jhd1313m1_lcdSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class Jhd1313m1_lcdSample{
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_i2clcd");
30
-		}catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-	
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		//! [Interesting]
38 29
         upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(1, 0x3E, 0x62);

+ 0
- 9
examples/java/Joystick12_exampleSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class Joystick12_exampleSample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_joystick12");
30
-		}catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-	
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		//! [Interesting]
38 29
 		// Instantiate a joystick on analog pins A0 and A1

+ 0
- 9
examples/java/LDT0028Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class LDT0028Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_ldt0028");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 

+ 0
- 9
examples/java/LSM303Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class LSM303Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_lsm303");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate LSM303 compass on I2C

+ 0
- 9
examples/java/Lcm1602_i2cSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class Lcm1602_i2cSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_i2clcd");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		upm_i2clcd.Lcm1602 lcd = new upm_i2clcd.Lcm1602(0, 0x27);

+ 0
- 9
examples/java/Lcm1602_parallelSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class Lcm1602_parallelSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_i2clcd");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// LCD connection:

+ 0
- 9
examples/java/LoL_exampleSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class LoL_exampleSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_lol");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		upm_lol.LoL sensor = new upm_lol.LoL();

+ 0
- 9
examples/java/M24LR64ESample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class M24LR64ESample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_m24lr64e");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate an M24LR64E on I2C bus 0

+ 0
- 9
examples/java/MAX44000Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class MAX44000Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_max44000");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		upm_max44000.MAX44000 sensor = new upm_max44000.MAX44000(0);

+ 0
- 9
examples/java/MHZ16Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class MHZ16Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_mhz16");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate a MHZ16 serial CO2 sensor on uart 0.

+ 0
- 9
examples/java/MMA7455Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class MMA7455Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_mma7455");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		upm_mma7455.MMA7455 sensor = new upm_mma7455.MMA7455(0);

+ 0
- 9
examples/java/MMA7660Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class MMA7660Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_mma7660");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate an MMA7660 on I2C bus 0

+ 0
- 9
examples/java/MPL3115A2Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class MPL3115A2Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_mpl3115a2");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate a MPL3115A2 sensor on I2C

+ 0
- 9
examples/java/MPR121Sample.java View File

@@ -1,14 +1,5 @@
1 1
 public class MPR121Sample {
2 2
 
3
-	static {
4
-		try {
5
-			System.loadLibrary("javaupm_mpr121");
6
-		} catch (UnsatisfiedLinkError e) {
7
-			System.err.println("error in loading native library");
8
-			System.exit(-1);
9
-		}
10
-	}
11
-
12 3
 	private static void printButtons(upm_mpr121.MPR121 touch) {
13 4
 		boolean buttonPresed = false;
14 5
 

+ 0
- 9
examples/java/MPU9150Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class MPU9150Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_mpu9150");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		upm_mpu9150.MPU9150 sensor = new upm_mpu9150.MPU9150();

+ 0
- 9
examples/java/MQ2Sample.java View File

@@ -26,15 +26,6 @@
26 26
 public class MQ2Sample {
27 27
 	private static final short resolution = 5;
28 28
 
29
-	static {
30
-		try {
31
-			System.loadLibrary("javaupm_gas");
32
-		} catch (UnsatisfiedLinkError e) {
33
-			System.err.println("error in loading native library");
34
-			System.exit(-1);
35
-		}
36
-	}
37
-
38 29
 	public static void main(String[] args) throws InterruptedException {
39 30
 		// ! [Interesting]
40 31
 		short[] buffer = new short[128];

+ 0
- 9
examples/java/MQ303ASample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class MQ303ASample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_mq303a");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// Instantiate an mq303a sensor on analog pin A0
38 29
 

+ 0
- 9
examples/java/MQ5Sample.java View File

@@ -25,15 +25,6 @@
25 25
 public class MQ5Sample {
26 26
 	private static final short resolution = 7;
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_gas");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		short[] buffer = new short[128];

+ 0
- 9
examples/java/MY9221Sample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class MY9221Sample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_my9221");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9
38 29
 		upm_my9221.MY9221 bar = new upm_my9221.MY9221((short) 8, (short) 9);

+ 0
- 9
examples/java/MY9221_ledbarSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class MY9221_ledbarSample{
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_my9221");
30
-		}catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-	
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		//! [Interesting]
38 29
         // Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9

+ 0
- 9
examples/java/MicrophoneSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class MicrophoneSample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_mic");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		short[] buffer = new short[128];

+ 0
- 9
examples/java/NRF24L01_receiverSample.java View File

@@ -31,15 +31,6 @@ public class NRF24L01_receiverSample {
31 31
 	static private final byte[] broadcast_address = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
32 32
 			(byte) 0xFF, (byte) 0xFF};
33 33
 
34
-	static {
35
-		try {
36
-			System.loadLibrary("javaupm_nrf24l01");
37
-		} catch (UnsatisfiedLinkError e) {
38
-			System.err.println("error in loading native library");
39
-			System.exit(-1);
40
-		}
41
-	}
42
-
43 34
 	public static void main(String[] args) throws InterruptedException {
44 35
 		// ! [Interesting]
45 36
 		upm_nrf24l01.NRF24L01 comm = new upm_nrf24l01.NRF24L01((short) 7, (short) 8);

+ 0
- 9
examples/java/NRF24L01_transmitterSample.java View File

@@ -32,15 +32,6 @@ public class NRF24L01_transmitterSample {
32 32
 	static private byte[] tx_buffer = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
33 33
 			0x00};
34 34
 
35
-	static {
36
-		try {
37
-			System.loadLibrary("javaupm_nrf24l01");
38
-		} catch (UnsatisfiedLinkError e) {
39
-			System.err.println("error in loading native library");
40
-			System.exit(-1);
41
-		}
42
-	}
43
-
44 35
 	public static void main(String[] args) throws InterruptedException {
45 36
 		// ! [Interesting]
46 37
 		upm_nrf24l01.NRF24L01 comm = new upm_nrf24l01.NRF24L01((short) 7, (short) 8);

+ 0
- 9
examples/java/NUNCHUCKSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class NUNCHUCKSample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_nunchuck");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		// Instantiate a nunchuck controller bus 0

+ 0
- 9
examples/java/OTP538USample.java View File

@@ -25,15 +25,6 @@
25 25
 public class OTP538USample {
26 26
 	private static final float OTP538U_AREF = 5;
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_otp538u");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate a OTP538U on analog pins A0 and A1

+ 0
- 9
examples/java/PPD42NSSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class PPD42NSSample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_ppd42ns");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		// Instantiate a dust sensor on GPIO pin D8

+ 0
- 9
examples/java/PulsensorSample.java View File

@@ -25,15 +25,6 @@
25 25
 import upm_pulsensor.*;
26 26
 
27 27
 public class PulsensorSample {
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_pulsensor");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	static class PulsensorCallback extends Callback {
38 29
 		public PulsensorCallback() {
39 30
 			super();

+ 0
- 9
examples/java/RFR359FSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class RFR359FSample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_rfr359f");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		// Instantiate an RFR359F digital pin D2

+ 0
- 9
examples/java/RPR220Sample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class RPR220Sample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_rpr220");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		// This example uses a simple method to determine current status

+ 0
- 9
examples/java/RPR220_intrSample.java View File

@@ -28,15 +28,6 @@ public class RPR220_intrSample {
28 28
 
29 29
 	public static int counter = 0;
30 30
 
31
-	static {
32
-		try {
33
-			System.loadLibrary("javaupm_rpr220");
34
-		} catch (UnsatisfiedLinkError e) {
35
-			System.err.println("error in loading native library");
36
-			System.exit(-1);
37
-		}
38
-	}
39
-
40 31
 	public static void main(String[] args) throws InterruptedException {
41 32
 		// ! [Interesting]
42 33
 		// This example uses an interrupt handler to increment a counter

+ 0
- 9
examples/java/RotaryEncoderSample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class RotaryEncoderSample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_rotaryencoder");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		// Instantiate a Grove Rotary Encoder, using signal pins D2 and D3

+ 0
- 9
examples/java/SSD1308_oledSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class SSD1308_oledSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_i2clcd");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	static private final int[] IntelLogo = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
38 29
 			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,
39 30
 			192, 192, 224, 224, 224, 224, 240, 240, 248, 248, 120, 120, 120, 120, 60, 60, 60, 60,

+ 0
- 9
examples/java/SSD1327_oledSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class SSD1327_oledSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_i2clcd");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	static private final int[] SeeedLogo = new int[]{0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08,
38 29
 			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00,
39 30
 			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, 0x00, 0x00, 0x00, 0x00,

+ 0
- 9
examples/java/ST7735Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class ST7735Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_st7735");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		upm_st7735.ST7735 lcd = new upm_st7735.ST7735((short) 7, (short) 4, (short) 9, (short) 8);

+ 0
- 9
examples/java/StepMotorSample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class StepMotorSample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_stepmotor");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		upm_stepmotor.StepMotor sensor = new upm_stepmotor.StepMotor(4, 6);

+ 0
- 9
examples/java/TM1637Sample.java View File

@@ -27,15 +27,6 @@ import java.time.LocalDateTime;
27 27
 //NOT TESTED!!!
28 28
 public class TM1637Sample {
29 29
 
30
-	static {
31
-		try {
32
-			System.loadLibrary("javaupm_tm1637");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println("error in loading native library");
35
-			System.exit(-1);
36
-		}
37
-	}
38
-
39 30
 	public static void main(String[] args) throws InterruptedException {
40 31
 		// ! [Interesting]
41 32
 		// TM1637 on pins 0 (clk) and 1 (dio)

+ 0
- 9
examples/java/TP401Sample.java View File

@@ -23,15 +23,6 @@
23 23
  */
24 24
 
25 25
 public class TP401Sample {
26
-	static {
27
-		try {
28
-			System.loadLibrary("javaupm_gas");
29
-		} catch (UnsatisfiedLinkError e) {
30
-			System.err.println("error in loading native library");
31
-			System.exit(-1);
32
-		}
33
-	}
34
-
35 26
 	private static String airQuality(int value) {
36 27
 		if (value < 50)
37 28
 			return "Fresh Air";

+ 0
- 9
examples/java/TSL2561Sample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class TSL2561Sample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_tsl2561");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		// Instantiate a TSL2561 Digital Light Sensor on I2C

+ 0
- 9
examples/java/TTP223Sample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class TTP223Sample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_ttp223");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		upm_ttp223.TTP223 touch = new upm_ttp223.TTP223(7);

+ 0
- 9
examples/java/ULN200XASample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class ULN200XASample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_uln200xa");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate a Stepper motor on a ULN200XA Dual H-Bridge.

+ 0
- 9
examples/java/Ublox6Sample.java View File

@@ -25,15 +25,6 @@
25 25
 public class Ublox6Sample {
26 26
 	private static final int BUFFERLENGTH = 256;
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_ublox6");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate a Ublox6 GPS device on uart 0

+ 0
- 9
examples/java/WT5001Sample.java View File

@@ -27,15 +27,6 @@ import java.io.IOException;
27 27
 //NOT TESTED!!!
28 28
 public class WT5001Sample {
29 29
 
30
-	static {
31
-		try {
32
-			System.loadLibrary("javaupm_wt5001");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println("error in loading native library");
35
-			System.exit(-1);
36
-		}
37
-	}
38
-
39 30
 	static private void printUsage() {
40 31
 		System.out.println("Usage: java WT5001Sample <command>");
41 32
 		System.out.println("Commands:");

+ 1
- 13
examples/java/WaterLevelSensor.java View File

@@ -26,18 +26,6 @@ import upm_waterlevel.WaterLevel;
26 26
 
27 27
 public class WaterLevelSensor {
28 28
 
29
-	static {
30
-		try {
31
-			System.loadLibrary("javaupm_waterlevel");
32
-			System.loadLibrary("mraajava");
33
-		} catch (UnsatisfiedLinkError e) {
34
-			System.err.println(
35
-					"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
36
-							e);
37
-			System.exit(1);
38
-		}
39
-	}
40
-
41 29
 	public static void main(String[] args) {
42 30
 		// TODO Auto-generated method stub
43 31
 		//! [Interesting]
@@ -61,4 +49,4 @@ public class WaterLevelSensor {
61 49
 		//! [Interesting]
62 50
 	}
63 51
 
64
-}
52
+}

+ 0
- 9
examples/java/YG1006Sample.java View File

@@ -24,15 +24,6 @@
24 24
 
25 25
 public class YG1006Sample {
26 26
 
27
-	static {
28
-		try {
29
-			System.loadLibrary("javaupm_yg1006");
30
-		} catch (UnsatisfiedLinkError e) {
31
-			System.err.println("error in loading native library");
32
-			System.exit(-1);
33
-		}
34
-	}
35
-
36 27
 	public static void main(String[] args) throws InterruptedException {
37 28
 		// ! [Interesting]
38 29
 		// Instantiate a yg1006 flame sensor on digital pin D2

+ 0
- 9
examples/java/ZFM20Sample.java View File

@@ -25,15 +25,6 @@
25 25
 //NOT TESTED!!!
26 26
 public class ZFM20Sample {
27 27
 
28
-	static {
29
-		try {
30
-			System.loadLibrary("javaupm_zfm20");
31
-		} catch (UnsatisfiedLinkError e) {
32
-			System.err.println("error in loading native library");
33
-			System.exit(-1);
34
-		}
35
-	}
36
-
37 28
 	public static void main(String[] args) throws InterruptedException {
38 29
 		// ! [Interesting]
39 30
 		// Instantiate a ZFM20 Fingerprint reader on UART 0