sensor

How to change Android proximity sensor sensitivity?

假如想象 提交于 2019-12-06 16:55:37
I coded an app based on proximity sensor , but I would like to be able to give users the ability to change the sensitivity of the sensor. Is it possible? If yes how to do it? Just "implements SensorEventListener" and follow the code : public void onCallStateChanged(int state, String incomingNumber) { switch (state) { case TelephonyManager.CALL_STATE_IDLE: System.out.println("My Call IDLE"); CallState = false; StartAudioSpeacker(); System.out.println("Is phone speaker : "+ audioManager.isSpeakerphoneOn()); if (audioManager.isSpeakerphoneOn()) { audioManager.setSpeakerphoneOn(false);

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

隐身守侯 提交于 2019-12-06 14:30:32
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 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; } static int get_temp(void) { return ((sht11_sensor.value(SHT11_SENSOR_TEMP) / 10) - 396) / 10; } For

Trilateration of a signal using Time Difference(TDOA)

丶灬走出姿态 提交于 2019-12-06 14:29:02
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 problem is more on how multilateration works, it's unclear for me based on my reference, and I couldn't

How to calibrate the Lego NXT color sensor with LeJos NXJ?

孤街醉人 提交于 2019-12-06 11:09:49
I'm currently writing on a program about detecting different colored balls and sorting them with the Lego NXT and its color sensor. At the beginning it worked quite good but now, the color sensor always returnes the color ID "7" (white), no matter what i do. On the documentation page i found something about a calibration (calibrateHigh() and calibrateLow()). Does anybody know how to use this calibration or is my color sensor broken? I tried it with this code: package com.mydomain; import lejos.nxt.*; public class HelloWorld { public static void main(String[] args) throws Exception {

turn the screen on/off in Android with a shake

青春壹個敷衍的年華 提交于 2019-12-06 07:41:53
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 the brightness to 0.0f, the phone won't turn the screen again... not until I press the power button,

xserver didn't show result from Xsensor

余生颓废 提交于 2019-12-06 06:58: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 it on serial USB, but still there is no output on xserve. note: when i try to open MoteVeiw the output

Android - mandatory sensors?

帅比萌擦擦* 提交于 2019-12-06 06:56:58
问题 Is there a mandatory list for hardware on Android devices (e.g. magnetic field, distance)? If not, which one are common? 回答1: These things are defined in the Android Compatibility Definition Document (CDD). Here is the current one. Check out the hardware-sensors section [7.3.]. As far as I can see all sensors are optional. Most devices are equipped with the following sensors: GPS Accelerometer Proximity sensor Magnetic field Light Gravity (from an API viewpoint, some might be the same on a

android accelerometer accuracy is extremely poor

孤街浪徒 提交于 2019-12-06 05:58:09
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); } } The actual accelerometer readings are very inaccurate - about 2%-5% fluctuations even when it's

What exactly is a rotation matrix?

本小妞迷上赌 提交于 2019-12-06 05:33:16
问题 i have come across this code which uses the phones sensors to get the orientation of the device in degrees along the 3 axes... this value is calculated from a 4x4 matrix called rotation matrix.. so i was wondering what kind of data is stored in the rotation matrix ? the code is similar to the one in this example Android: Problems calculating the Orientation of the Device 回答1: The Wikipedia article about rotation matrices is reasonable. Basically, the rotation matrix tells you how to map a

Proximity sensor in Swift (from Objective-C)

故事扮演 提交于 2019-12-06 03:58:07
问题 I'm a relatively new user to swift and now, I need to take advantage of the proximity sensor of an iPhone. I don't matter the distance, but I want to know when something is near the iPhone. So I found this code in Objective-C that worked, but I need it in Swift. I have tried some ways, but any worked. So here is the code I need: - (void) activateProximitySensor { UIDevice *device = [UIDevice currentDevice]; device.proximityMonitoringEnabled = YES; if (device.proximityMonitoringEnabled == YES)