sensor

turn the screen on/off in Android with a shake

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 03:06:13
问题 I'm making an app that needs to toggle the screen on/off when the user shakes the phone. So far, I've got a SensorEventListener that listens to the shakes as suggested in the answer to this question. When I detect a shake, I change the value of the screen's brightness as suggested in this question's answer. It all works great if I don't actually turn the screen off... if I set the brightness to 0.01f through the public void setBright(float value) method it works perfectly. However, if I set

Trilateration of a signal using Time Difference(TDOA)

烈酒焚心 提交于 2019-12-08 03:02:20
问题 I am having some trouble to find or implement an algorithm to find a signal source. The objective of my work is to find the sound emitter position. To accomplish this I am using three vibration sensors. The technique that I am using is multilateration that is based on the time difference of arrival. The time difference of arrival between each sensor are found using Cross Correlation of the received signals. I already implemented the algorithm to find the time difference of arrival, but my

xserver didn't show result from Xsensor

这一生的挚爱 提交于 2019-12-07 23:14:11
问题 i have build the example Xsensor for 420cc then i plug it and put the sensor board on it, on other side for the serial board i build Xsniffer (TOSBase) to the mote that i need to put it on the 520MiP serial USB. To see the message send form mote 1 to the mote 2, i try to open cygwin terminal and type xserve -device=com4 then it open serial device but there is nothing display !! i have try to change the (TOSBase) by (XMeshBase) to see if this will be useful, but this mote with (XMeshBase) use

android accelerometer accuracy is extremely poor

亡梦爱人 提交于 2019-12-07 20:12:57
问题 Wrote a simple program that prints out accelerometer output. mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE); mSensorManager.registerListener(this,mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST); It turns out that: The accelerometer output is always set to "lowest" as determined by: public void onAccuracyChanged(Sensor sensor, int accuracy) { if (collectingData){ accelPrecision.setText("accelerometer accuracy: " + accuracy); } }

How to read temperature, humidity and light measures with contiki-OS?

China☆狼群 提交于 2019-12-07 19:14:54
问题 I would like to know how to measure temperature, light and humidity with a contiki program. I'm using a TelosB mote (sky mote), so these three sensors are integrated in the mote itself. PS: I'm working on Contiki-OS 2.7 回答1: In order to use the light and temperature sensors you will need to add the next: #include "dev/sht11-sensor.h" #include "dev/light-sensor.h" Then you can use the next functions: static int get_light(void) { return 10 * light_sensor.value(LIGHT_SENSOR_PHOTOSYNTHETIC) / 7;

Determining north using the android phone

☆樱花仙子☆ 提交于 2019-12-07 07:03:34
问题 I looked over SensorManager and was still unsure, how do I detect if the phone is looking at true north (or any other direction for that matter). 回答1: If you are just looking for a sample, the publishers of Professional Android 2 Application Development have all their example code available for download and there is a compass application in chapter 14. 来源: https://stackoverflow.com/questions/2808811/determining-north-using-the-android-phone

Does iPhone allow Light sensors as input?

风格不统一 提交于 2019-12-07 05:49:28
问题 I was just wondering whether iPhone developement allows light sensors to be used, as buttons or action elements?? I found this link online... Possible to use Light Sensor as a Button? [Archive] - Touch Arcade If anyone could shed some light on the issue, I'd appreciate the help? Cheers. Divanshu. 回答1: An official answer by an Apple rep is on the Apple Dev Forums (login required): There's no supported way to get at the ambient light sensor. If you'd like to see such support added in the future

Count Steps using accelometer in android [duplicate]

一个人想着一个人 提交于 2019-12-07 04:54:25
This question already has answers here : Closed 7 years ago . Possible Duplicate: How to Count the Number of Steps Using the Accelerometer Are there any well known algorithms to count steps based on the accelerometer? Hi i have developed android application. In one module I have to create a pedometer . Now at this stage I have to count the steps user walked by using accelormeter. I have search on internet and found different methods but none of that working. I have tried this Does anyone have an idea how to achieve my goal? Any help is appreciated. The simplest solution would be to have a time

Why does camera frame rate fluctuate when fusing another sensor?

孤者浪人 提交于 2019-12-07 03:48:24
I am a new baby in Android programming so that I am facing a problem related to videos when doing my research project. In the project, we would like to build an application which uses both videos recorded by a built-in front camera and acceleration sensed by a built-in accelerometer. My problem is that the frame rate of these videos usually fluctuates from 15 fps to 30 fps even though I have set the camera fixed at 30 fps in the source code. I tried to close the data stream of the accelerometer to test the consistency of the frame rate. However it has been still fluctuated. I tested this

“Custom” sensor event rates don't seem to work with SensorManager.registerListener(SensorEventListener listener, Sensor sensor, int rate)

对着背影说爱祢 提交于 2019-12-07 02:02:38
问题 UPDATED: I was able to solve the specific problem I was having by introducing a class-scope static counter and just ignoring ever x number of events. But I'd still like to know what I'm doing wrong re: registering the listener with a hint in microseconds instead of using one of the four given constants. An Activity in my app is engaging the sensors to obtain the orientation of the device, determine the roll, and utilize it. I am using SensorManager.registerListener(SensorEventListener