accelerometer

Sony Smartwatch SW2 - accelerometer output rate

微笑、不失礼 提交于 2019-12-10 00:30:33
问题 From the sample code of the SDK, I can read the accelerometer at 4-5Hz by using: registerListener(listener, Sensor.SensorRates.SENSOR_DELAY_FASTEST, Sensor.SensorInterruptMode.SENSOR_INTERRUPT_ENABLED); but it does not work when using registerFixedRateListener(). How to read accelerometer data from SW2 with higher rate? for example 10Hz, 20Hz... Thanks. 回答1: I'm able to read values on my SW 2 at 10Hz with disabled interrupts using sensor.registerFixedRateListener(mListener, Sensor.SensorRates

Android accelerometer difficulties

不问归期 提交于 2019-12-09 23:19:58
问题 I'm a beginner in Android game Development, and I developing a small Game. I am facing some difficulties with the Motion Sensor: Accelerometer. this game is in Landscape mode. I want if my phone tilts in right, my character also goes right. ( same thing for left ) And when I stop tilting Character in the game should stop moving. But i don't understand really good the operation of the accelerometer, here is my code: @Override public void onSensorChanged(SensorEvent event) { synchronized (this)

Accelerometer & Calibration - iPhone SDK

谁都会走 提交于 2019-12-09 19:00:42
问题 I need to use the functionality of an accelerometer in my iphone game. I just have to move an image by tilting the device. However most videos on youtube just show the tilt feature that is somehow inverted and forget to include the calibration. I want the user to calibrate their device to whatever position they're in. Does anyone know how I should get started on this? Your help is greatly appreciated, Kevin 回答1: I made an app like this once. I'll post it here, but it's for iOS 4... http:/

Android: reading accelerometer without memory allocation?

不羁岁月 提交于 2019-12-09 06:52:42
问题 I am developing a game for Android (2.1+), using the accelerometer as user input. I use a sensor listener that I register at the beginning of the activity with the sensor manager, as follows: mSensorManager.registerListener(SystemRegistry.inputSystem.mSensorListener, accSensor, SensorManager.SENSOR_DELAY_UI); That works well and I just read the accelerometer values in onSensorChanged(SensorEvent event) in order to use it in my game loop: public void onSensorChanged(SensorEvent event){ accX =

Is it possible to detect motion when screen is off?

你。 提交于 2019-12-09 03:14:08
问题 My app simply need to detect any motion of the device while screen is off. I know that accelerometer is used for this task but it don't work while screen is off in all devices. this is a list of devices http://www.saltwebsites.com/2012/android-accelerometers-screen-off so is there a way of taking accelerometer sensor data while screen is off that works on all devices? or is there a way to detect motion using another sensors? 回答1: Partial Wake Lock is all you need to access accelerometer

Access Android sensors via NDK

旧街凉风 提交于 2019-12-08 23:11:23
问题 I need read about 100 samples per second off the accelerometer on a Android, and at a fixed sample rate. The current sensormanager does or offers neither. I've read Need to read android sensors really fast He seems to have access to the driver code which made his life easier. I am curious if anyone has been able to do something like this through the NDK w/o that type of knowledge. Thanks in advance! 回答1: I have taken a look at sensor.h, and the API looks very promising; however, a little

What is android accelerometer min and max range

坚强是说给别人听的谎言 提交于 2019-12-08 19:42:20
问题 Hi i would like to know the minimum and maximum range of accelerometer in android. i need it for x,y,z. do any one have exact values of it? 回答1: There is no "exact values" in general -- it will vary by device. The Sensor class has getMaximumRange() . Since acceleration can be positive or negative, I would assume you can safely multiply that value by -1 to get the minimum value. 回答2: It measures a physical magnitude! I don't really know if there is some practical limit introduced by the

Detect Device Rotation/Movement in iOS sdk

…衆ロ難τιáo~ 提交于 2019-12-08 13:57:48
问题 I want to detect the device movement & Rotation just like when we are taking the Panorama Picture. I want to move the Image same as the arrow while we capture Panorama Image. There are many apps who uses this functionality but I can't able to find anything for this. Help me to solve this. Thank you, 回答1: I think you need to use motion sensor in iphone ,But it wont give you the accurate result. What motion does iPhone SDK give exactly? But i am providing the motion sensor delegate methods code

Android: Determining the angle of tilt using only accelerometers

ぃ、小莉子 提交于 2019-12-08 11:22:49
问题 I am trying to compute the angle of a leg instantaneously regarding an initial position using accelerometer readings. As I approached this, I decided I needed to record an averaged gravity vector and compute some angle between my current reading and that. Theoretically it seems plausible: the reading of gravity is different on each position of the leg, so in stationary positions the readings should converge to a vector I can use to find the angular displacement of the leg, with respect to the

speedometer using accelerometer no output

大城市里の小女人 提交于 2019-12-08 11:12:34
问题 i have created an speedometer application which uses accelerometer to calculate device speed. here is the code: `package com.exacmple.speedo; import java.util.Date; import java.util.Timer; import java.util.TimerTask; import android.app.Activity; import android.content.Context; import android.hardware.SensorListener; import android.hardware.SensorManager; import android.os.Bundle; import android.os.Handler; import android.widget.TextView; public class Speedometer extends Activity {