mirror of
https://github.com/eclipse/upm.git
synced 2025-07-02 18:01:18 +03:00
SWIGJAVA: Remove the last JAVA ifdefs from src
Removed all references to #ifdef SWIGJAVA and JAVACALLBACK from the library source. All java-specific source code has been moved to the corresponding library's .i file for java. * Update library source * Update examples where necessary * The function pointer methodology has been remove from libraries which provided callbacks as both a class and a function pointer implementation. Examples were updated to use the class version of callbacks. * Updated documentation for SWIGJAVA Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
@ -23,12 +23,14 @@
|
||||
*/
|
||||
|
||||
//NOT TESTED!!!
|
||||
|
||||
import java.util.AbstractList;
|
||||
import java.lang.Float;
|
||||
|
||||
public class H3LIS331DLSample {
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
//! [Interesting]
|
||||
int[] val;
|
||||
float[] accel;
|
||||
|
||||
// Instantiate an H3LIS331DL on I2C bus 0
|
||||
upm_h3lis331dl.H3LIS331DL sensor = new upm_h3lis331dl.H3LIS331DL(0);
|
||||
@ -39,14 +41,14 @@ public class H3LIS331DLSample {
|
||||
while(true){
|
||||
sensor.update();
|
||||
|
||||
val = sensor.getRawXYZ();
|
||||
System.out.println( "Raw: X: " + val[0] + " Y: " + val[1] + " Z: " + val[2] );
|
||||
upm_h3lis331dl.IntVector val = sensor.getRawXYZ();
|
||||
System.out.println( "Raw: X: " + val.get(0) + " Y: " + val.get(1) + " Z: " + val.get(2) );
|
||||
|
||||
accel = sensor.getAcceleration();
|
||||
System.out.println( "Acceleration: X: " + accel[0] + " Y: " + accel[1] + " Z: " + accel[2] );
|
||||
upm_h3lis331dl.FloatVector accel = sensor.getAcceleration();
|
||||
System.out.println( "Acceleration: X: " + accel.get(0) + " Y: " + accel.get(1) + " Z: " + accel.get(2) );
|
||||
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
//! [Interesting]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user