kxcjk1013: code cleanup and update sensor description

Code cleanup and proper close iio device in destructor.

KXCJK-1013 is tri-axis accelerometer from Kionix.
This sensor can measure acceleration in metre per second squared or in
G-forces.

The library provided is libupm-kxcjk1013.so.0.4.0.
The example provided is kxcjk1013-example where it will print x,y,z axis when
trigger buffer data is ready.

Signed-off-by: Lay, Kuan Loon <kuan.loon.lay@intel.com>
Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Lay, Kuan Loon
2016-04-21 18:31:51 +08:00
committed by Noel Eck
parent bbb31fcab2
commit 398d50de2e
3 changed files with 23 additions and 19 deletions

3
examples/c++/kxcjk1013.cxx Normal file → Executable file
View File

@ -44,8 +44,7 @@ data_callback(char* data)
{
float x, y, z;
accelerometer->extract3Axis(data, &x, &y, &z);
printf("%.1f %.1f %.1f\n", x, y, z);
// usleep(100);
printf("% .1f % .1f % .1f\n", x, y, z);
}
int