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>
This commit is contained in:
Stefan Andritoiu 2015-12-04 16:34:36 +02:00 committed by Mihai Tudor Panu
parent 1667569560
commit 9bf184129e
92 changed files with 9 additions and 868 deletions

View File

@ -24,15 +24,6 @@
public class A110XSample { 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 { public static void main(String[] args) throws InterruptedException {
//! [Interesting] //! [Interesting]
// Instantiate an A110X sensor on digital pin D2 // Instantiate an A110X sensor on digital pin D2

View File

@ -28,15 +28,6 @@ public class A110X_intrSample {
public static int counter=0; 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 { public static void main(String[] args) throws InterruptedException {
//! [Interesting] //! [Interesting]
// Instantiate an A110X sensor on digital pin D2 // Instantiate an A110X sensor on digital pin D2

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class ADC121C021Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate an ADC121C021 on I2C bus 0 // Instantiate an ADC121C021 on I2C bus 0

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class Adxl345Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
short[] val; short[] val;

View File

@ -26,18 +26,6 @@ import upm_apds9002.APDS9002;
public class 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) { public static void main(String[] args) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
//! [Interesting] //! [Interesting]
@ -56,4 +44,4 @@ public class Apds9002 {
//! [Interesting] //! [Interesting]
} }
} }

View File

@ -24,15 +24,6 @@
public class BISS0001Sample{ 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 { public static void main(String[] args) throws InterruptedException {
//! [Interesting] //! [Interesting]
// Instantiate a Grove Motion sensor on GPIO pin D7 // Instantiate a Grove Motion sensor on GPIO pin D7

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class BMPX8XSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a BMPX8X sensor on I2C // Instantiate a BMPX8X sensor on I2C

View File

@ -24,15 +24,6 @@
public class BuzzerSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
int chord[] = { int chord[] = {

View File

@ -24,15 +24,6 @@
public class Buzzer_soundSample { 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 { public static void main(String[] args) throws InterruptedException {
//! [Interesting] //! [Interesting]
int chord[] = { int chord[] = {

View File

@ -24,15 +24,6 @@
public class CJQ4435Sample { 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 { public static void main(String[] args) throws InterruptedException {
// Instantiate a CJQ4435 MOSFET on a PWM capable digital pin D3 // Instantiate a CJQ4435 MOSFET on a PWM capable digital pin D3
upm_cjq4435.CJQ4435 mosfet = new upm_cjq4435.CJQ4435(3); upm_cjq4435.CJQ4435 mosfet = new upm_cjq4435.CJQ4435(3);

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class DS1307Sample { 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) { static private void printTime(upm_ds1307.DS1307 rtc) {
System.out.print("The time is: " + rtc.getMonth() + "/" + rtc.getDayOfMonth() + "/" System.out.print("The time is: " + rtc.getMonth() + "/" + rtc.getDayOfMonth() + "/"
+ rtc.getYear() + " " + rtc.getHours() + ":" + rtc.getMinutes() + ":" + rtc.getYear() + " " + rtc.getHours() + ":" + rtc.getMinutes() + ":"

View File

@ -26,15 +26,6 @@
public class ENC03RSample { public class ENC03RSample {
private static final long CALIBRATION_SAMPLES = 1000; 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]

View File

@ -23,15 +23,6 @@
*/ */
public class ES08ASample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_servo.ES08A servo = new upm_servo.ES08A(6); upm_servo.ES08A servo = new upm_servo.ES08A(6);

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class GROVESCAMSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a Grove Serial Camera on UART 0 // Instantiate a Grove Serial Camera on UART 0

View File

@ -27,15 +27,6 @@ public class GUVAS12DSample {
private static final float GUVAS12D_AREF = 5; private static final float GUVAS12D_AREF = 5;
private static final int SAMPLES_PER_QUERY = 1024; 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a GUVAS12D on analog pin A3 // Instantiate a GUVAS12D on analog pin A3

View File

@ -29,15 +29,6 @@ public class GroveButton_intrSample {
public static int counter = 0; 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_grove.GroveButton b = new upm_grove.GroveButton(2); upm_grove.GroveButton b = new upm_grove.GroveButton(2);

View File

@ -26,19 +26,6 @@ import upm_grovecollision.*;
public class 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) { public static void main(String[] args) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// Initializing the sensor on D2 on the Base Shield // Initializing the sensor on D2 on the Base Shield
@ -60,4 +47,4 @@ public class GroveCollision {
System.out.println("Exiting"); System.out.println("Exiting");
} }
} }

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class GroveEHRSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a Grove Ear-clip Heart Rate sensor on digital pin D2 // Instantiate a Grove Ear-clip Heart Rate sensor on digital pin D2

View File

@ -25,18 +25,6 @@ import upm_groveemg.GroveEMG;
public class 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) { public static void main(String[] args) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
//! [Interesting] //! [Interesting]
@ -56,4 +44,4 @@ public class GroveEmg {
} }
} }
//! [Interesting] //! [Interesting]
} }

View File

@ -26,18 +26,6 @@ import upm_grovegsr.GroveGSR;
public class 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) { public static void main(String[] args) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
@ -59,4 +47,4 @@ public class GroveGsr {
//! [Interesting] //! [Interesting]
} }
} }

View File

@ -23,15 +23,6 @@
*/ */
public class GroveLEDSample { 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 { public static void main (String args[]) throws InterruptedException {
//! [Interesting] //! [Interesting]
upm_grove.GroveLed led = new upm_grove.GroveLed(2); upm_grove.GroveLed led = new upm_grove.GroveLed(2);

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class GroveLed_multiSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a grove LED on D2. Here we are controlling a Grove // Instantiate a grove LED on D2. Here we are controlling a Grove

View File

@ -23,15 +23,6 @@
*/ */
public class GroveLightSample { 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 { public static void main(String args[]) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_grove.GroveLight gl = new upm_grove.GroveLight(2); upm_grove.GroveLight gl = new upm_grove.GroveLight(2);

View File

@ -24,15 +24,6 @@
public class GroveLineFinderSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a Grove Line Finder sensor on digital pin D2 // Instantiate a Grove Line Finder sensor on digital pin D2

View File

@ -26,15 +26,6 @@ public class GroveMDSample {
private static final short speed50 = 127; private static final short speed50 = 127;
private static final short speed0 = 0; 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate an I2C Grove Motor Driver on I2C bus 0 // Instantiate an I2C Grove Motor Driver on I2C bus 0

View File

@ -36,18 +36,6 @@ import upm_gas.thresholdContext;
public class GroveMQ3 { 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) { public static void main(String[] args) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
//! [Interesting] //! [Interesting]
@ -79,4 +67,4 @@ public class GroveMQ3 {
//! [Interesting] //! [Interesting]
} }
} }

View File

@ -36,18 +36,6 @@ import upm_gas.thresholdContext;
public class GroveMQ9 { 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) { public static void main(String[] args) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
//! [Interesting] //! [Interesting]
@ -79,4 +67,4 @@ public class GroveMQ9 {
//! [Interesting] //! [Interesting]
} }
} }

View File

@ -23,15 +23,6 @@
*/ */
public class GroveMoistureSample { 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 { public static void main(String args[]) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_grovemoisture.GroveMoisture gm = new upm_grovemoisture.GroveMoisture(1); upm_grovemoisture.GroveMoisture gm = new upm_grovemoisture.GroveMoisture(1);

View File

@ -26,18 +26,6 @@ import upm_groveo2.GroveO2;
public class GroveO2Example { 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) { public static void main(String[] args) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
//! [Interesting] //! [Interesting]
@ -55,4 +43,4 @@ public class GroveO2Example {
} }
//! [Interesting] //! [Interesting]
} }
} }

View File

@ -26,18 +26,6 @@ import upm_at42qt1070.AT42QT1070;
public class GroveQTouch { 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) { public static void main(String[] args) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
// Instantiating the Q Touch sensor on the I2C bus 0 // Instantiating the Q Touch sensor on the I2C bus 0

View File

@ -23,15 +23,6 @@
*/ */
public class GroveRelaySample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Create the button object using UART // Create the button object using UART

View File

@ -24,15 +24,6 @@
public class GroveRotarySample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_grove.GroveRotary knob = new upm_grove.GroveRotary(0); upm_grove.GroveRotary knob = new upm_grove.GroveRotary(0);

View File

@ -23,15 +23,6 @@
*/ */
public class GroveSlideSample { 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 { public static void main (String args[]) throws InterruptedException {
//! [Interesting] //! [Interesting]
// Instantiate new grove slide potentiometer on analog pin A0 // Instantiate new grove slide potentiometer on analog pin A0

View File

@ -24,15 +24,6 @@
public class GroveSpeakerSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a Grove Speaker on digital pin D2 // Instantiate a Grove Speaker on digital pin D2

View File

@ -23,15 +23,6 @@
*/ */
public class GroveTempSample { 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 { public static void main (String args[]) throws InterruptedException {
//! [Interesting] //! [Interesting]
upm_grove.GroveTemp temp = new upm_grove.GroveTemp(3); upm_grove.GroveTemp temp = new upm_grove.GroveTemp(3);

View File

@ -27,15 +27,6 @@ public class GroveVDivSample {
private static final short gain3 = 3; private static final short gain3 = 3;
private static final short gain10 = 10; 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a Grove Voltage Divider sensor on analog pin A0 // Instantiate a Grove Voltage Divider sensor on analog pin A0

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class GroveWFSSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a Grove Water Flow Sensor on digital pin D2 // Instantiate a Grove Water Flow Sensor on digital pin D2

View File

@ -24,15 +24,6 @@
public class GroveWaterSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a Grove Water sensor on digital pin D2 // Instantiate a Grove Water sensor on digital pin D2

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class H3LIS331DLSample { 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 { public static void main(String[] args) throws InterruptedException {
//! [Interesting] //! [Interesting]
int[] val; int[] val;

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class HCSR04Sample { public class HCSR04Sample {
static {
try {
System.loadLibrary("javaupm_hcsr04");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
// ! [Interesting] // ! [Interesting]
public static void main(String[] args) throws InterruptedException { public static void main(String[] args) throws InterruptedException {
upm_hcsr04.HCSR04 sonar = new upm_hcsr04.HCSR04((short) 5, (short) 6); upm_hcsr04.HCSR04 sonar = new upm_hcsr04.HCSR04((short) 5, (short) 6);

View File

@ -27,15 +27,6 @@ public class HM11Sample {
private static final int BUFSIZ = 1024; 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() { private static void printUsage() {
System.out.println("Usage: java HM11Sample [AT command]"); System.out.println("Usage: java HM11Sample [AT command]");

View File

@ -27,15 +27,6 @@ public class HMTRPSample {
static private final int bufferLength = 255; 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() { private static void printUsage() {
System.out.println("Usage:"); System.out.println("Usage:");
System.out.println("Pass a commandline argument (any argument) to this program"); System.out.println("Pass a commandline argument (any argument) to this program");

View File

@ -26,18 +26,6 @@ import upm_hp20x.HP20X;
public class HP20xExample { 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) { public static void main(String[] args) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
@ -59,4 +47,4 @@ public class HP20xExample {
} }
//! [Interesting] //! [Interesting]
} }
} }

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class HTU21DSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
float humidity = 0; float humidity = 0;

View File

@ -24,15 +24,6 @@
public class Hmc5883lSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate on I2C // Instantiate on I2C

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class Itg3200Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
short[] rot; short[] rot;

View File

@ -24,15 +24,6 @@
public class Jhd1313m1Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(0); upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(0);

View File

@ -24,15 +24,6 @@
public class Jhd1313m1_lcdSample{ 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 { public static void main(String[] args) throws InterruptedException {
//! [Interesting] //! [Interesting]
upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(1, 0x3E, 0x62); upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(1, 0x3E, 0x62);

View File

@ -24,15 +24,6 @@
public class Joystick12_exampleSample { 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 { public static void main(String[] args) throws InterruptedException {
//! [Interesting] //! [Interesting]
// Instantiate a joystick on analog pins A0 and A1 // Instantiate a joystick on analog pins A0 and A1

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class LDT0028Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class LSM303Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate LSM303 compass on I2C // Instantiate LSM303 compass on I2C

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class Lcm1602_i2cSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_i2clcd.Lcm1602 lcd = new upm_i2clcd.Lcm1602(0, 0x27); upm_i2clcd.Lcm1602 lcd = new upm_i2clcd.Lcm1602(0, 0x27);

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class Lcm1602_parallelSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// LCD connection: // LCD connection:

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class LoL_exampleSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_lol.LoL sensor = new upm_lol.LoL(); upm_lol.LoL sensor = new upm_lol.LoL();

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class M24LR64ESample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate an M24LR64E on I2C bus 0 // Instantiate an M24LR64E on I2C bus 0

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class MAX44000Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_max44000.MAX44000 sensor = new upm_max44000.MAX44000(0); upm_max44000.MAX44000 sensor = new upm_max44000.MAX44000(0);

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class MHZ16Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a MHZ16 serial CO2 sensor on uart 0. // Instantiate a MHZ16 serial CO2 sensor on uart 0.

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class MMA7455Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_mma7455.MMA7455 sensor = new upm_mma7455.MMA7455(0); upm_mma7455.MMA7455 sensor = new upm_mma7455.MMA7455(0);

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class MMA7660Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate an MMA7660 on I2C bus 0 // Instantiate an MMA7660 on I2C bus 0

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class MPL3115A2Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a MPL3115A2 sensor on I2C // Instantiate a MPL3115A2 sensor on I2C

View File

@ -1,14 +1,5 @@
public class MPR121Sample { 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) { private static void printButtons(upm_mpr121.MPR121 touch) {
boolean buttonPresed = false; boolean buttonPresed = false;

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class MPU9150Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_mpu9150.MPU9150 sensor = new upm_mpu9150.MPU9150(); upm_mpu9150.MPU9150 sensor = new upm_mpu9150.MPU9150();

View File

@ -26,15 +26,6 @@
public class MQ2Sample { public class MQ2Sample {
private static final short resolution = 5; 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
short[] buffer = new short[128]; short[] buffer = new short[128];

View File

@ -24,15 +24,6 @@
public class MQ303ASample { 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 { public static void main(String[] args) throws InterruptedException {
// Instantiate an mq303a sensor on analog pin A0 // Instantiate an mq303a sensor on analog pin A0

View File

@ -25,15 +25,6 @@
public class MQ5Sample { public class MQ5Sample {
private static final short resolution = 7; 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
short[] buffer = new short[128]; short[] buffer = new short[128];

View File

@ -24,15 +24,6 @@
public class MY9221Sample { 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 { public static void main(String[] args) throws InterruptedException {
// Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9 // 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); upm_my9221.MY9221 bar = new upm_my9221.MY9221((short) 8, (short) 9);

View File

@ -24,15 +24,6 @@
public class MY9221_ledbarSample{ 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 { public static void main(String[] args) throws InterruptedException {
//! [Interesting] //! [Interesting]
// Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9 // Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9

View File

@ -24,15 +24,6 @@
public class MicrophoneSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
short[] buffer = new short[128]; short[] buffer = new short[128];

View File

@ -31,15 +31,6 @@ public class NRF24L01_receiverSample {
static private final byte[] broadcast_address = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, static private final byte[] broadcast_address = {(byte) 0xFF, (byte) 0xFF, (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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_nrf24l01.NRF24L01 comm = new upm_nrf24l01.NRF24L01((short) 7, (short) 8); upm_nrf24l01.NRF24L01 comm = new upm_nrf24l01.NRF24L01((short) 7, (short) 8);

View File

@ -32,15 +32,6 @@ public class NRF24L01_transmitterSample {
static private byte[] tx_buffer = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, static private byte[] tx_buffer = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
0x00}; 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_nrf24l01.NRF24L01 comm = new upm_nrf24l01.NRF24L01((short) 7, (short) 8); upm_nrf24l01.NRF24L01 comm = new upm_nrf24l01.NRF24L01((short) 7, (short) 8);

View File

@ -24,15 +24,6 @@
public class NUNCHUCKSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a nunchuck controller bus 0 // Instantiate a nunchuck controller bus 0

View File

@ -25,15 +25,6 @@
public class OTP538USample { public class OTP538USample {
private static final float OTP538U_AREF = 5; 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a OTP538U on analog pins A0 and A1 // Instantiate a OTP538U on analog pins A0 and A1

View File

@ -24,15 +24,6 @@
public class PPD42NSSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a dust sensor on GPIO pin D8 // Instantiate a dust sensor on GPIO pin D8

View File

@ -25,15 +25,6 @@
import upm_pulsensor.*; import upm_pulsensor.*;
public class PulsensorSample { 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 { static class PulsensorCallback extends Callback {
public PulsensorCallback() { public PulsensorCallback() {
super(); super();

View File

@ -24,15 +24,6 @@
public class RFR359FSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate an RFR359F digital pin D2 // Instantiate an RFR359F digital pin D2

View File

@ -24,15 +24,6 @@
public class RPR220Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// This example uses a simple method to determine current status // This example uses a simple method to determine current status

View File

@ -28,15 +28,6 @@ public class RPR220_intrSample {
public static int counter = 0; 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// This example uses an interrupt handler to increment a counter // This example uses an interrupt handler to increment a counter

View File

@ -24,15 +24,6 @@
public class RotaryEncoderSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a Grove Rotary Encoder, using signal pins D2 and D3 // Instantiate a Grove Rotary Encoder, using signal pins D2 and D3

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class SSD1308_oledSample { 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, 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, 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, 192, 192, 224, 224, 224, 224, 240, 240, 248, 248, 120, 120, 120, 120, 60, 60, 60, 60,

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class SSD1327_oledSample { 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, 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, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, 0x00, 0x00, 0x00, 0x00,

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class ST7735Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_st7735.ST7735 lcd = new upm_st7735.ST7735((short) 7, (short) 4, (short) 9, (short) 8); upm_st7735.ST7735 lcd = new upm_st7735.ST7735((short) 7, (short) 4, (short) 9, (short) 8);

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class StepMotorSample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_stepmotor.StepMotor sensor = new upm_stepmotor.StepMotor(4, 6); upm_stepmotor.StepMotor sensor = new upm_stepmotor.StepMotor(4, 6);

View File

@ -27,15 +27,6 @@ import java.time.LocalDateTime;
//NOT TESTED!!! //NOT TESTED!!!
public class TM1637Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// TM1637 on pins 0 (clk) and 1 (dio) // TM1637 on pins 0 (clk) and 1 (dio)

View File

@ -23,15 +23,6 @@
*/ */
public class TP401Sample { 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) { private static String airQuality(int value) {
if (value < 50) if (value < 50)
return "Fresh Air"; return "Fresh Air";

View File

@ -24,15 +24,6 @@
public class TSL2561Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a TSL2561 Digital Light Sensor on I2C // Instantiate a TSL2561 Digital Light Sensor on I2C

View File

@ -24,15 +24,6 @@
public class TTP223Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
upm_ttp223.TTP223 touch = new upm_ttp223.TTP223(7); upm_ttp223.TTP223 touch = new upm_ttp223.TTP223(7);

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class ULN200XASample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a Stepper motor on a ULN200XA Dual H-Bridge. // Instantiate a Stepper motor on a ULN200XA Dual H-Bridge.

View File

@ -25,15 +25,6 @@
public class Ublox6Sample { public class Ublox6Sample {
private static final int BUFFERLENGTH = 256; 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a Ublox6 GPS device on uart 0 // Instantiate a Ublox6 GPS device on uart 0

View File

@ -27,15 +27,6 @@ import java.io.IOException;
//NOT TESTED!!! //NOT TESTED!!!
public class WT5001Sample { 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() { static private void printUsage() {
System.out.println("Usage: java WT5001Sample <command>"); System.out.println("Usage: java WT5001Sample <command>");
System.out.println("Commands:"); System.out.println("Commands:");

View File

@ -26,18 +26,6 @@ import upm_waterlevel.WaterLevel;
public class WaterLevelSensor { 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) { public static void main(String[] args) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
//! [Interesting] //! [Interesting]
@ -61,4 +49,4 @@ public class WaterLevelSensor {
//! [Interesting] //! [Interesting]
} }
} }

View File

@ -24,15 +24,6 @@
public class YG1006Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a yg1006 flame sensor on digital pin D2 // Instantiate a yg1006 flame sensor on digital pin D2

View File

@ -25,15 +25,6 @@
//NOT TESTED!!! //NOT TESTED!!!
public class ZFM20Sample { 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 { public static void main(String[] args) throws InterruptedException {
// ! [Interesting] // ! [Interesting]
// Instantiate a ZFM20 Fingerprint reader on UART 0 // Instantiate a ZFM20 Fingerprint reader on UART 0