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 {
static {
try {
System.loadLibrary("javaupm_a110x");
}catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
//! [Interesting]
// Instantiate an A110X sensor on digital pin D2

View File

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

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class ADC121C021Sample {
static {
try {
System.loadLibrary("javaupm_adc121c021");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate an ADC121C021 on I2C bus 0

View File

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

View File

@ -26,18 +26,6 @@ import upm_apds9002.APDS9002;
public class Apds9002 {
static {
try {
System.loadLibrary("javaupm_apds9002");
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//! [Interesting]

View File

@ -24,15 +24,6 @@
public class BISS0001Sample{
static {
try {
System.loadLibrary("javaupm_biss0001");
}catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
//! [Interesting]
// Instantiate a Grove Motion sensor on GPIO pin D7

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class BMPX8XSample {
static {
try {
System.loadLibrary("javaupm_bmpx8x");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a BMPX8X sensor on I2C

View File

@ -24,15 +24,6 @@
public class BuzzerSample {
static {
try {
System.loadLibrary("javaupm_buzzer");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
int chord[] = {

View File

@ -24,15 +24,6 @@
public class Buzzer_soundSample {
static {
try {
System.loadLibrary("javaupm_buzzer");
}catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
//! [Interesting]
int chord[] = {

View File

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

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class DS1307Sample {
static {
try {
System.loadLibrary("javaupm_ds1307");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
static private void printTime(upm_ds1307.DS1307 rtc) {
System.out.print("The time is: " + rtc.getMonth() + "/" + rtc.getDayOfMonth() + "/"
+ rtc.getYear() + " " + rtc.getHours() + ":" + rtc.getMinutes() + ":"

View File

@ -26,15 +26,6 @@
public class ENC03RSample {
private static final long CALIBRATION_SAMPLES = 1000;
static {
try {
System.loadLibrary("javaupm_enc03r");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]

View File

@ -23,15 +23,6 @@
*/
public class ES08ASample {
static {
try {
System.loadLibrary("javaupm_servo");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_servo.ES08A servo = new upm_servo.ES08A(6);

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class GROVESCAMSample {
static {
try {
System.loadLibrary("javaupm_grovescam");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a Grove Serial Camera on UART 0

View File

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

View File

@ -29,15 +29,6 @@ public class GroveButton_intrSample {
public static int counter = 0;
static {
try {
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_grove.GroveButton b = new upm_grove.GroveButton(2);

View File

@ -26,19 +26,6 @@ import upm_grovecollision.*;
public class GroveCollision {
static boolean shouldRun = true;
static {
try {
System.loadLibrary("javaupm_grovecollision");
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
// Initializing the sensor on D2 on the Base Shield

View File

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

View File

@ -25,18 +25,6 @@ import upm_groveemg.GroveEMG;
public class GroveEmg {
static {
try {
System.loadLibrary("javaupm_groveemg");
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//! [Interesting]

View File

@ -26,18 +26,6 @@ import upm_grovegsr.GroveGSR;
public class GroveGsr {
static {
try {
System.loadLibrary("javaupm_grovegsr");
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub

View File

@ -23,15 +23,6 @@
*/
public class GroveLEDSample {
static {
try {
System.loadLibrary("javaupm_grove");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main (String args[]) throws InterruptedException {
//! [Interesting]
upm_grove.GroveLed led = new upm_grove.GroveLed(2);

View File

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

View File

@ -23,15 +23,6 @@
*/
public class GroveLightSample {
static {
try {
System.loadLibrary("javaupm_grove");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String args[]) throws InterruptedException {
// ! [Interesting]
upm_grove.GroveLight gl = new upm_grove.GroveLight(2);

View File

@ -24,15 +24,6 @@
public class GroveLineFinderSample {
static {
try {
System.loadLibrary("javaupm_grovelinefinder");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a Grove Line Finder sensor on digital pin D2

View File

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

View File

@ -36,18 +36,6 @@ import upm_gas.thresholdContext;
public class GroveMQ3 {
static {
try {
System.loadLibrary("javaupm_gas");
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//! [Interesting]

View File

@ -36,18 +36,6 @@ import upm_gas.thresholdContext;
public class GroveMQ9 {
static {
try {
System.loadLibrary("javaupm_gas");
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//! [Interesting]

View File

@ -23,15 +23,6 @@
*/
public class GroveMoistureSample {
static {
try {
System.loadLibrary("javaupm_grovemoisture");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String args[]) throws InterruptedException {
// ! [Interesting]
upm_grovemoisture.GroveMoisture gm = new upm_grovemoisture.GroveMoisture(1);

View File

@ -26,18 +26,6 @@ import upm_groveo2.GroveO2;
public class GroveO2Example {
static {
try {
System.loadLibrary("javaupm_groveo2");
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//! [Interesting]

View File

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

View File

@ -23,15 +23,6 @@
*/
public class GroveRelaySample {
static {
try {
System.loadLibrary("javaupm_grove");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Create the button object using UART

View File

@ -24,15 +24,6 @@
public class GroveRotarySample {
static {
try {
System.loadLibrary("javaupm_grove");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_grove.GroveRotary knob = new upm_grove.GroveRotary(0);

View File

@ -23,15 +23,6 @@
*/
public class GroveSlideSample {
static {
try {
System.loadLibrary("javaupm_grove");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main (String args[]) throws InterruptedException {
//! [Interesting]
// Instantiate new grove slide potentiometer on analog pin A0

View File

@ -24,15 +24,6 @@
public class GroveSpeakerSample {
static {
try {
System.loadLibrary("javaupm_grovespeaker");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a Grove Speaker on digital pin D2

View File

@ -23,15 +23,6 @@
*/
public class GroveTempSample {
static {
try {
System.loadLibrary("javaupm_grove");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main (String args[]) throws InterruptedException {
//! [Interesting]
upm_grove.GroveTemp temp = new upm_grove.GroveTemp(3);

View File

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

View File

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

View File

@ -24,15 +24,6 @@
public class GroveWaterSample {
static {
try {
System.loadLibrary("javaupm_grovewater");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a Grove Water sensor on digital pin D2

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class H3LIS331DLSample {
static {
try {
System.loadLibrary("javaupm_h3lis331dl");
}catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
//! [Interesting]
int[] val;

View File

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

View File

@ -27,15 +27,6 @@ public class HM11Sample {
private static final int BUFSIZ = 1024;
static {
try {
System.loadLibrary("javaupm_hm11");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
private static void printUsage() {
System.out.println("Usage: java HM11Sample [AT command]");

View File

@ -27,15 +27,6 @@ public class HMTRPSample {
static private final int bufferLength = 255;
static {
try {
System.loadLibrary("javaupm_hmtrp");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
private static void printUsage() {
System.out.println("Usage:");
System.out.println("Pass a commandline argument (any argument) to this program");

View File

@ -26,18 +26,6 @@ import upm_hp20x.HP20X;
public class HP20xExample {
static {
try {
System.loadLibrary("javaupm_hp20x");
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class HTU21DSample {
static {
try {
System.loadLibrary("javaupm_htu21d");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
float humidity = 0;

View File

@ -24,15 +24,6 @@
public class Hmc5883lSample {
static {
try {
System.loadLibrary("javaupm_hmc5883l");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate on I2C

View File

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

View File

@ -24,15 +24,6 @@
public class Jhd1313m1Sample {
static {
try {
System.loadLibrary("javaupm_i2clcd");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(0);

View File

@ -24,15 +24,6 @@
public class Jhd1313m1_lcdSample{
static {
try {
System.loadLibrary("javaupm_i2clcd");
}catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
//! [Interesting]
upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(1, 0x3E, 0x62);

View File

@ -24,15 +24,6 @@
public class Joystick12_exampleSample {
static {
try {
System.loadLibrary("javaupm_joystick12");
}catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
//! [Interesting]
// Instantiate a joystick on analog pins A0 and A1

View File

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

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class LSM303Sample {
static {
try {
System.loadLibrary("javaupm_lsm303");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate LSM303 compass on I2C

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class Lcm1602_i2cSample {
static {
try {
System.loadLibrary("javaupm_i2clcd");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_i2clcd.Lcm1602 lcd = new upm_i2clcd.Lcm1602(0, 0x27);

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class Lcm1602_parallelSample {
static {
try {
System.loadLibrary("javaupm_i2clcd");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// LCD connection:

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class LoL_exampleSample {
static {
try {
System.loadLibrary("javaupm_lol");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_lol.LoL sensor = new upm_lol.LoL();

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class M24LR64ESample {
static {
try {
System.loadLibrary("javaupm_m24lr64e");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate an M24LR64E on I2C bus 0

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class MAX44000Sample {
static {
try {
System.loadLibrary("javaupm_max44000");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_max44000.MAX44000 sensor = new upm_max44000.MAX44000(0);

View File

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

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class MMA7455Sample {
static {
try {
System.loadLibrary("javaupm_mma7455");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_mma7455.MMA7455 sensor = new upm_mma7455.MMA7455(0);

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class MMA7660Sample {
static {
try {
System.loadLibrary("javaupm_mma7660");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate an MMA7660 on I2C bus 0

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class MPL3115A2Sample {
static {
try {
System.loadLibrary("javaupm_mpl3115a2");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a MPL3115A2 sensor on I2C

View File

@ -1,14 +1,5 @@
public class MPR121Sample {
static {
try {
System.loadLibrary("javaupm_mpr121");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
private static void printButtons(upm_mpr121.MPR121 touch) {
boolean buttonPresed = false;

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class MPU9150Sample {
static {
try {
System.loadLibrary("javaupm_mpu9150");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_mpu9150.MPU9150 sensor = new upm_mpu9150.MPU9150();

View File

@ -26,15 +26,6 @@
public class MQ2Sample {
private static final short resolution = 5;
static {
try {
System.loadLibrary("javaupm_gas");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
short[] buffer = new short[128];

View File

@ -24,15 +24,6 @@
public class MQ303ASample {
static {
try {
System.loadLibrary("javaupm_mq303a");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// Instantiate an mq303a sensor on analog pin A0

View File

@ -25,15 +25,6 @@
public class MQ5Sample {
private static final short resolution = 7;
static {
try {
System.loadLibrary("javaupm_gas");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
short[] buffer = new short[128];

View File

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

View File

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

View File

@ -24,15 +24,6 @@
public class MicrophoneSample {
static {
try {
System.loadLibrary("javaupm_mic");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
short[] buffer = new short[128];

View File

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

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,
0x00};
static {
try {
System.loadLibrary("javaupm_nrf24l01");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_nrf24l01.NRF24L01 comm = new upm_nrf24l01.NRF24L01((short) 7, (short) 8);

View File

@ -24,15 +24,6 @@
public class NUNCHUCKSample {
static {
try {
System.loadLibrary("javaupm_nunchuck");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a nunchuck controller bus 0

View File

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

View File

@ -24,15 +24,6 @@
public class PPD42NSSample {
static {
try {
System.loadLibrary("javaupm_ppd42ns");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a dust sensor on GPIO pin D8

View File

@ -25,15 +25,6 @@
import upm_pulsensor.*;
public class PulsensorSample {
static {
try {
System.loadLibrary("javaupm_pulsensor");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
static class PulsensorCallback extends Callback {
public PulsensorCallback() {
super();

View File

@ -24,15 +24,6 @@
public class RFR359FSample {
static {
try {
System.loadLibrary("javaupm_rfr359f");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate an RFR359F digital pin D2

View File

@ -24,15 +24,6 @@
public class RPR220Sample {
static {
try {
System.loadLibrary("javaupm_rpr220");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// This example uses a simple method to determine current status

View File

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

View File

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

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class SSD1308_oledSample {
static {
try {
System.loadLibrary("javaupm_i2clcd");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
static private final int[] IntelLogo = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 192,
192, 192, 224, 224, 224, 224, 240, 240, 248, 248, 120, 120, 120, 120, 60, 60, 60, 60,

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class SSD1327_oledSample {
static {
try {
System.loadLibrary("javaupm_i2clcd");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
static private final int[] SeeedLogo = new int[]{0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, 0x00, 0x00, 0x00, 0x00,

View File

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

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class StepMotorSample {
static {
try {
System.loadLibrary("javaupm_stepmotor");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_stepmotor.StepMotor sensor = new upm_stepmotor.StepMotor(4, 6);

View File

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

View File

@ -23,15 +23,6 @@
*/
public class TP401Sample {
static {
try {
System.loadLibrary("javaupm_gas");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
private static String airQuality(int value) {
if (value < 50)
return "Fresh Air";

View File

@ -24,15 +24,6 @@
public class TSL2561Sample {
static {
try {
System.loadLibrary("javaupm_tsl2561");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a TSL2561 Digital Light Sensor on I2C

View File

@ -24,15 +24,6 @@
public class TTP223Sample {
static {
try {
System.loadLibrary("javaupm_ttp223");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_ttp223.TTP223 touch = new upm_ttp223.TTP223(7);

View File

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

View File

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

View File

@ -27,15 +27,6 @@ import java.io.IOException;
//NOT TESTED!!!
public class WT5001Sample {
static {
try {
System.loadLibrary("javaupm_wt5001");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
static private void printUsage() {
System.out.println("Usage: java WT5001Sample <command>");
System.out.println("Commands:");

View File

@ -26,18 +26,6 @@ import upm_waterlevel.WaterLevel;
public class WaterLevelSensor {
static {
try {
System.loadLibrary("javaupm_waterlevel");
System.loadLibrary("mraajava");
} catch (UnsatisfiedLinkError e) {
System.err.println(
"Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" +
e);
System.exit(1);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
//! [Interesting]

View File

@ -24,15 +24,6 @@
public class YG1006Sample {
static {
try {
System.loadLibrary("javaupm_yg1006");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a yg1006 flame sensor on digital pin D2

View File

@ -25,15 +25,6 @@
//NOT TESTED!!!
public class ZFM20Sample {
static {
try {
System.loadLibrary("javaupm_zfm20");
} catch (UnsatisfiedLinkError e) {
System.err.println("error in loading native library");
System.exit(-1);
}
}
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Instantiate a ZFM20 Fingerprint reader on UART 0