ketai lib can not find sensor
in
Android Processing
ā€¢
2 years ago
Hi I use ketai lib. URL
http://danielsauter.com/display.php?project_id=113
I want to use the sensor of Android(Sony Ericsson SO-01C).
1)GyroscopeSensor
2)OrientationSensor
But, I can not use. Example program(Multisensor.pde) is retruned sensor list.
KetaiSensor sensor: BMA150 accelerometer:1
KetaiSensor sensor: AK8975 Compass:3
KetaiSensor sensor: AK8975 Compass Raw:3
KetaiSensor sensor: AK8975 Magnetic Field:2
KetaiSensor sensor: APDS9702 Proximity:8
KetaiSensor sensor: Gravity Sensor:9
KetaiSensor sensor: Linear Acceleration Sensor:10
KetaiSensor sensor: Rotation Vector Sensor:11
This list don't have GyroscopeSensor & OrientationSensorļ¼ˇ
I can not read GyroscopeSensor & OrientationSensor. I can read accelerometer & Magnetic Field.
I try this program. but I can not read OrientationSensor.
Help Me
//Multisensor2.pde program
import edu.uic.ketai.*;
KetaiSensor sensor;
PVector orientation;
void setup()
{
sensor = new KetaiSensor(this);
sensor.start();
sensor.list();
orientation = new PVector();
}
void draw()
{
background(78, 93, 75);
text("Orientation :" + "\n"
+ "x: " + nfp(orientation.x, 4, 2) + "\n"
+ "y: " + nfp(orientation.y, 4, 2) + "\n"
+ "z: " + nfp(orientation.z, 4, 2) + "\n"
, 20, 0);
}
void onOrientationEvent(float x, float y, float z, long time, int accuracy)
{
orientation.set(x, y, z);
}
public void mousePressed() {
if (sensor.isStarted())
sensor.stop();
else
sensor.start();
println("KetaiSensor isStarted: " + sensor.isStarted());
}
1