java: fix Java return types in ADXL355

Signed-off-by: Petre <petre.p.eftime@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Petre
2015-08-26 18:27:48 +03:00
committed by Mihai Tudor Panu
parent 2455938691
commit 4f30959a43
4 changed files with 67 additions and 0 deletions

View File

@@ -72,6 +72,15 @@ void ADXL335::values(int *xVal, int *yVal, int *zVal)
*zVal = mraa_aio_read(m_aioZ);
}
#ifdef SWIGJAVA
int *ADXL335::values()
{
int *v = new int[3];
values(&v[0], &v[1], &v[2]);
return v;
}
#endif
void ADXL335::acceleration(float *xAccel, float *yAccel, float *zAccel)
{
int x, y, z;
@@ -87,6 +96,15 @@ void ADXL335::acceleration(float *xAccel, float *yAccel, float *zAccel)
*zAccel = (zVolts - m_zeroZ) / ADXL335_SENSITIVITY;
}
#ifdef SWIGJAVA
float *ADXL335::acceleration()
{
float *v = new float[3];
acceleration(&v[0], &v[1], &v[2]);
return v;
}
#endif
void ADXL335::calibrate()
{
// make sure the sensor is still before running calibration.