sensor

Android Accelerometer Profiling

老子叫甜甜 提交于 2019-11-29 19:55:15
I have written a simple Activity which is a SensorEventListener for Sensor.TYPE_ACCELEROMETER . In my onSensorChanged(SensorEvent event) i just pick the values in X,Y,Z format and write them on to a file. Added to this X,Y,Z is a label, the label is specific to the activity i am performing. so its X,Y,Z,label Like this i obtain my activity profile. Would like to have suggestions on what operations to perform after data collection so as to remove noise and get the best data for an activity. The main intent of this data collection is to construct a user activity detection application using

Get multiple sensor data at the same time in Android

和自甴很熟 提交于 2019-11-29 13:41:07
I am now trying to create an app to monitoring the vibration. I use accelerometer to finish the job, when the recorded acceleration exceed certain threshold, I call it a trigger. When there's a trigger, I want to log the acceleration, magnetic field, light level data (from different sensors) at the trigger time to a file. The problem now is that: I can get data from individual sensor, but couldn't figure out a way how to get the data from multiple sensors at the same time. For example: I can set a sensorlistener to monitoring the change of accelerometer, when I record the acceleration data,

View Sensor list on android device

馋奶兔 提交于 2019-11-29 12:50:41
I am a new to Android development and I would like to create an application which shows the list of sensors on my Android device. I tried to find this but without the success. Can you please help me. Here is the solution how to do this: /////////////// List of Sensors ////////////////////////////// listeCapteurs = (ListView) findViewById(R.id.ListView01); SensorManager sensorManager= (SensorManager)getSystemService(Context.SENSOR_SERVICE); List<Sensor> listSensor= sensorManager.getSensorList(Sensor.TYPE_ALL); List<String> listSensorType = new ArrayList<String>(); for(int i=0; i<listSensor.size

Accessing the ambient light sensor in iOS

天大地大妈咪最大 提交于 2019-11-29 12:04:18
问题 I'm working on a project in which it is really necessary to access the ambient light sensor. I searched a lot in Google and Stackoverflow, but couldn't find any useful information. Is it even possible to do so? I also tried to calculate the ambient light value by calculating the brightness out of the camera input, but the results aren't really precise, as the camera makes lot's of adjustments to the images, which distort the results. 回答1: To read the ambient light sensor data, you need to use

Android sensor: getRotationMatrix() returns wrong values, why?

风流意气都作罢 提交于 2019-11-29 10:28:42
问题 It's past several days since I started using this function and have not yet succeeded in obtaining valid results. What i want is basically convert acceleration vector from device's coordinates system, to real world coordinates . I' know that is possible because i have acceleration in relative coordinates and i know the orientation of the device in real world system. Reading Android developers seems that using getRotationMatrix() i get R = rotation matrix. So if i want A (acceleration vector

Get Device Moving Direction without GPS

谁说我不能喝 提交于 2019-11-29 08:52:32
With Which Sensor I Can Detect when device is moving to a direction In Absolute Coordinate(for example moving to +x or -x). I need accurate data,so i cannot use GPS . the Complete Task is to plot in paint(in computer) with android device sensors and this part of task in unknown for me. I'm a little confused about what you're asking. Do you want to put a device in your pocket and walk around, and make a plot of everywhere you walked? Or do you want to wave the device around in your hand like a 3-d mouse, for painting? For the latter, see Ali's suggestion above. If you want to do motion tracking

Meaning of “LSB/Unit” and “Unit/LSB”

天大地大妈咪最大 提交于 2019-11-29 06:16:42
问题 At the moment I'm playing with the LSM303DLHC accelerometer/magnetometer/thermometer. This is its datasheet: http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/DM00027543.pdf Everything is working quite well, but I don't know how to interpret the output values. The datasheet (page 9) says something like "1 mg/LSB" (no, it's not milligramm :D) about the linear acceleration sensitivity in my configuration. What the hell should that mean? Same with temperature

Getting Direction Vector in Android

不打扰是莪最后的温柔 提交于 2019-11-29 03:50:39
How can I get a direction vector representing the direction the back of the device is pointing relative to earth coordinates? For example, if place down on a desk (screen facing up) it should read [0,0,-1] and if held vertically facing north it should read [1,0,0], etc. I know how to calculate it from heading, pitch, and roll, as long as those are relative to earth coordinates. To be clear here I am not looking for angular velocity, but the actual current angle relative to the plane tangent to the earth. So if the device is held vertically and facing north, the angle "alpha" should read 0 or

SensorEventListener doesn't get unregistered with unregisterListener() method

僤鯓⒐⒋嵵緔 提交于 2019-11-29 01:04:21
I have very simple Android app: in activity I have a button and I start/stop the OrientationListener. However, after unregistering it, in ddms I can still see the thread android.hardware.SensorManager$SensorThread] (Running) . The registration code: sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); List<Sensor> sensors = sensorManager.getSensorList(Sensor.TYPE_ORIENTATION); if (sensors.size() > 0) { sensor = sensors.get(0); running = sensorManager.registerListener(sensorEventListener, sensor, SensorManager.SENSOR_DELAY_FASTEST); } and unregistration: try { if

How to read serial port data from JavaScript

╄→尐↘猪︶ㄣ 提交于 2019-11-28 21:27:02
问题 I connected an Arduino to my laptop using USB, and I can read the serial data using Processing. Is there any way to get this data in real time into a local webbrowser? For example, a text field that shows the value from the serial port? It does not have to be connected to the internet. The JavaScript version of Processing does not support the following code, which would have been the ideal solution. The Processing code is: myPort = new Serial(this, Serial.list()[0], 9600); // read a byte from