upm/examples/java/ECS1030_Example.java
Mihai Tudor Panu 89d5de43e0 license: update to SPDX style license text throughout
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2020-03-05 15:13:36 -08:00

39 lines
1.0 KiB
Java

/*
* Author: Abhishek Malik <abhishek.malik@intel.com>
* Copyright (c) 2016 Intel Corporation.
*
* This program and the accompanying materials are made available under the
* terms of the The MIT License which is available at
* https://opensource.org/licenses/MIT.
*
* SPDX-License-Identifier: MIT
*/
import upm_ecs1030.ECS1030;
public class ECS1030_Example {
static {
try {
System.loadLibrary("javaupm_ecs1030");
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]
ECS1030 sensor = new ECS1030((short)0);
while(true){
System.out.println("I = "+sensor.getCurrency_A()+", Power = "+sensor.getPower_A());
System.out.println("I = "+sensor.getCurrency_B()+", Power = "+sensor.getPower_B());
}
//! [Interesting]
}
}