sensor

How to implement/debug a sensor driver in ANDROID

Does anyone know of a walk-through or any examples of any code to setup sensors in android. I have the drivers available to me. Also i have implemented the sensors library as instructed in the Android-Reference along the sensors.h template. I am still unable to get any response at the apps level. How do i trace this issue? what might...

how often should getRotationMatrix update?

I'm currently just bliting a rotation matrix onto the screen. The source of which is "RT" from; SensorManager.getRotationMatrix(Rt, I, accels, mags); Where accels and mags are from the sensors. The getRotationMatrix, and its display, are triggered once for every update of the acceleration sensor. Question; How often should get...

how to calibrate the orientation sensor in android?

hi there! im writing an app in google android 2.1 that needs to know which direction (n/w/s/e) the device (htc hero) is facing. the sensor and its listener is working great, but the values i get from the sensor are totally crappy. e.g. it tells me i'd be facing north when the device is facing sw or so... this seems to be a known proble...

Android - SensorManager strange behaviour of getOrientation

Hi, I need to retrieve the orientation of my phone. At the moment i wrote this : public void onSensorChanged(SensorEvent event) { switch (event.sensor.getType()){ case Sensor.TYPE_MAGNETIC_FIELD: this.mag_vals = event.values.clone(); this.sensorReady = true; break; case Sensor.TYPE_ACCELEROMETER: this.acc_vals = ...

Using accelerometer data to determine if something strikes the device

Hi all, I need some help with this problem. I want to detect when an object hits a device (which has an accelerometer built in) that's resting on a table. The hit/strike, say by a ball, causes a fast spike in the Z values and if the hit is in the center, very little y or x movement occurs. The problem I am facing is how to differenti...

Measuring short distances

What's the best way to wirelessly measure the distance between two objects (computer, smartphones or a specialised device) that are a few meters apart down to a ~10cm accuracy? Is this possible by piggybegging on WLan, bluetooth or GPS? ...

Question about the rotation of X axis on Android

I want to detect the correct rotations around X axis with Android sensors. After googling, I find this code: public void onSensorChanged(SensorEvent event) { Sensor sensor = event.sensor; switch(sensor.getType()) { case Sensor.TYPE_ACCELEROMETER: mAcc = event.values.clone(); break; case Sensor.TYPE_MAGNETIC_FIELD:...

Question about the rotation of X axis on Android

Possible Duplicate: Question about the rotation of X axis on Android I want to detect the correct rotations around X axis with Android sensors. After googling, I find this code: public void onSensorChanged(SensorEvent event) { Sensor sensor = event.sensor; switch(sensor.getType()) { case Sensor.TYPE_AC...

Can I monitor the iPhone proximity sensor without turning off screen? Also, landscape.

I've got the proximity sensor working so that I can trigger events when in proximity, but I'm trying to use it as a sort of dead man switch. The problem is that whenever in proximity, the screen turns off, which drastically reduces the usability of the app :P Also, the proximity sensor doesn't seem to activate when in landscape mode (I c...

iPhone proximity sensor in landscape not available?

Is the proximity sensor available in landscape mode? It only seems to work for me when I'm in portrait... ...

Where can I find C/C++ Linux API's for robotics?

Specifically for sending commands and receiving sensor data. ...

Android Sensor.TYPE_LIGHT unity

Hi, Does anybody knows the unity of the return value of Sensor.TYPE_LIGHT on Android ? Thanks. ...

Is it possible to use a microphone as a sensitive pressure sensor for a touch-screen?

This question is more about electronics than programming, but there's no StackExchange site for that yet (at least I was unable to find it). The idea is to open an electret microphone and glue a flat surface (for instance, a piece of glass) on it, and use an ADC to detect when someone presses it with the finger. The ADC will be attached...

How do interface a LIDAR device with MATLAB?

I have a Hokuyo USB LADAR/LIDAR. I have problem with interfacing or connecting it to MATLAB/Simulink, such that I can do all the processing in those software packages. I have already asked Hokuyo. They only provide C++ program interface (sample programming guide and libraries). How do I interface this to MATLAB/Simulink? ...

Can only get a value of false to return when accessing Sensor.TYPE_TEMPERATURE

The Google doc's cover every one of the sensors except the temperature sensor, but continue to say that you can access that data...........it's aggrevating as heck, the doc's are very good in some parts and very bad in others. I have no problem getting the data from the other sensors so I'm quite sure my code is good. Would love some i...

android sensormanager roll angle

The documentation says : "the roll represents the device's sideway tilt between -90 and 90 degrees on the X-axis. The tilt angle is 0 degrees when the device is flat on its back, -90 degrees when the screen faces left, and 90 degrees when the screen faces right." but on my two phones (HTC magic and HTC desire), I've got positive degrees ...

Problems with the Sensor API in J2ME

Hi. I have a problem with the JSR-256. It's working fine for most of the time but sometimes it just gets stuck. I have a SensorConnection, called sensor, and from time to time (i.e. from a TimerTask) I ask the sensor for some data like so: Data[] data = sensor.getData(1); However, as I said, sooner or later, the app calls the method a...

Android General Programming

I am attempting to write an app for the Android platform which is similar to a lot of code I have written in VB and C++. I plan on using sensor data from the device and doing calculations on that data. I am still working a lot of this, but wanted to know since I was going to need access to the motion sensors of the phone, where would be ...

Is there any sensor in iPhone can Detect the Temperature of the air?

Getting cooler these days, thought it's a good idea adding some temperature function in apps, anyone knows iPhone has the hardware to support that? ...

What is wrong with my androidbutton with SensorEventListener? (Simple?)

What I'm trying to do is if the user shakes the phone nothing happens. If then the user presses the button and shaking the phone plays a sound. When the user presses the button again the sound stops. This works the first time, but if the user does the same thing again can't the user stop the sound with a second click. The sound never sto...