All UI operations have to run on Main UI Thread. So if you want to show a toast message, this shouldn't done in a seperated Thread. In this case, toast message has to be in runOnUiThread() block as seen below. public class MainActivity extends Activity{ List<String>sName=new ArrayList<String>(); @Override protected void...
timer,arduino,sensor,arduino-ide,arduino-uno
Try testing the sensors by writing the analogRead to serial. My guess is that the analogRead will never really be 0 since there will always be ambient light. Your threshold should be more analogRead(sensor1) < somevalue )...
arduino,bluetooth-lowenergy,sensor,battery,atmega
You can't power it directly from a battery, because batteries do not output a constant voltage. You can use a switching regulator like the LM2936 and power your Arduino through the 5V pin. That would bypass the onboard regulator and supply your Arduino with a nice steady and efficient 5...
android,sensor,android-sensors
You need to think about what an accelerometer is and what it does. It's basically a force meter. It detects a force on the device, and measures it. It always tells you the current level of force (which will actually never be 0 due to gravity, unless you're in outer...
bluetooth-lowenergy,communication,sensor,firmware,texas-instruments
Unfortunately, SensorTag is a Slave device and cannot be changed to a Master. Thus, it only accepts incoming connections and has not any capability to establish a connection to an another remote device. You can invest in a CC2541 BLE Mini Development Kit from Texas Instruments: http://www.ti.com/tool/cc2541dk-mini Since the firmwire...
java,random,plot,sensor,graphing
Why don´t you try modulating your random signal with a sin(t) function: long n = 0; double randomWeight = 0.5; while(true) { nextVal = range.getRandomValue(); double temp = AMPLITUDE*(randomWeight*((double)nextVal)+(1.0-randomWeight)*Math.sin(2.0*Math.PI*((double)n)*WIDTH_FACTOR)); nextVal = (long)temp; n++; System.out.println(nextVal); StdDraw.point(prevVal, nextVal); StdDraw.line(t-1, prevVal, t, nextVal); StdDraw.show(100); prevVal = nextVal; t = (t+1) % 100; if(t...
You should look at Freescale's app note AN4481, which is referred to by the datasheet. Page 5 shows the single-byte read operation which is what you are doing, except that the register address write must not be followed by a STOP but instead uses a REPEATED-START. I'm not familiar with...
android,matlab,usb,signal-processing,sensor
As I teach (to my students) in such cases: "Google is your friend.", but I don't remember ever this lesson for me. In the Matlab File Exchange (http://www.mathworks.com/matlabcentral/fileexchange/40876) there is a free toolbox for analyzing output data. Of course, in the smartphone must be installed an application: SensorUdp (https://play.google.com/store/apps/details?id=jp.ac.ehime_u.cite.sasaki.SensorUdp). Matlab...
Here is the tutorial See here. Moving further, you need to have tables like this, // CREATE TABLE `your_database`.`tempmoi` ( `id` INT( 255 ) NOT NULL AUTO_INCREMENT , `temperature` VARCHAR( 255 ) NOT NULL , `pressure` VARCHAR( 255 ) NOT NULL , `humidity` VARCHAR( 255 ) NOT NULL , `timestamp`...
position,sensor,robot,kalman-filter,proximitysensor
I'm not familiar with that video at all, but he might mean that if you repeatedly add process noise (P = FPF' + Q) but never reduce P via measurement, then P can only increase. In general, though, I would caution you against considering the covariance matrix P as...
f.write(textdata+'\n') will get your job done When you use f.write('textdata\n') , Then it will treat "textdata" as a string just like "anmol" and not as variable name so the value is not substituted, However , removing it outside the "...." will get you desired results....
The iPhone has accelerometers, gyros, and GPS. With these, you can monitor motion of the phone, sudden shocks(like when the phone is picked up and put down), orientation, and over all motion. If outside, you can also use the GPS to pick up on motion and position (lat, long, course,...
arduino,microcontroller,sensor,pic,home-automation
If the sensors use I2C then the limit is 128 devices on the bus, but they each have to have a unique address which are sometimes "hard-coded" on the device by the manufacturer. The Arduino Wired library is used to read/write I2C and it only takes two pins. I2C is...
android,android-activity,sensor
The values measured by the sensor are received through the onSensorChanged method. Thats why you had to implement the SensorEventListener and register your class as the listener. This will get called whenever the value read by the sensor changes so you can just do whatever you need to do to...
android,box2d,andengine,game-physics,sensor
SOLVED! Ok so the idea to check if our player body left the body of our path is to count borders playerbody passes. So in contactlistener we make beginContact to add one to some int variable (lets say bordersPassed) and endContact subtracts one from it. So when our player is...
python,floating-point,sensor,twos-complement,texas-instruments
On disk and in memory integers are stored to a certain bit-width. Modern Python's ints allows us to ignore most of that detail because they can magically expand to whatever size is necessary, but sometimes when we get values from disk or other systems we have to think about how...
c,algorithm,math,methods,sensor
If your analog signals are roughly sinusoidal then you can think of them as the sine and cosine of the phase angle (one full 2mm travel would be 2 * pi radians of phase). In C (and other languages) you can use the atan2 function to convert from your analog...
controller,arduino,hardware,sensor,temperature
You need to connect the 18B20 to a microcontroller, or a 1-wire host controller, connected to the microcontroller. (The difference is whether you want to write your own 1-wire protocol code ... go with the host controller). You'll get a digital value for the temp, no ADC required.
as your logcat said, java.lang.SecurityException: Requires VIBRATE permission you need Vibrate permission. so you need add following line into manifest file: <uses-permission android:name="android.permission.VIBRATE"/> ...
android,sensor,android-wear,moto-360
You can write on the memory of your wearable, yes, but careful about the storage capacity. Just declare the file as you would on any other Android devices, and it should do the trick. However, you will have to work a little on the data given by the sensor, as...
service,sensor,android-wear,watch
Check if you requested android.permission.BODY_SENSORS permission in your both mobile and wearable AndroidManifest. Also, look into the logcat of your wearable device and grep for android.permission.BODY_SENSORS....
android,json,database,tags,sensor
If you want to upload your values to mySql database here is the steps : 1 - create table on the server with the fields needed. 2 - write php or any server side code to get the values from client 3 - implement the code in android JOSNParser.java import...
Sample Code to detect phone flipping could look like this: http://android-er.blogspot.in/2011/02/detect-phone-flipping.html So basically you should use the accelerometer of your smartphone and place your custom code to onSensorChanged...
ios,iphone,jailbreak,sensor,brightness
Located in private BackBoardServices.framework: float BKSDisplayBrightnessGetCurrent(); As for light sensor, couldn't find any methods to retrieve it's value. There're only three methods: check for existance of the sensor, enable/disable auto-brightness....
Problem solved, code is working. I was giving 3.3V to sensor as Vcc, then I realized that I should give 5v. It worked. Thank you for everyone.
There's 2 case scenarios: If the callback is asynchronous then it will spawn a new thread every time the method is called. This means that many of these methods can co-exist at the same time. If the callback is synchronous then it will spawn in the same thread (this is...
There are a few issues with your code. First you can't get the value of a variable or a define by dynamically using a string that is the name of the variable. It doesn't work that way in C. The easiest approach is to use an array and then just...
android,accelerometer,sensor,detect,vibration
Real answer- you're going to need to study DSP to get good results. This is a non-trivial problem. Quick overview- when a vibration occurs, you're going to see a sinusoidal attenuating wave pattern (the attenuating signal after the main vibration is called "ringing" and is a bad thing for us-...
networking,gps,sensor,wireless
All GPS modules support the NMEA protocol, so a system that should work with different GPS chips, will use that NMEA protocoll. Additionaly GPS modules support their own binary protocoll, but by default the NMEA protocoll is enabaled. Systems that reads from a GPS module, usually allow to configure the...
android,bluetooth,real-time,sensor,connectivity
This is one of those question.... First thing you need to do is to find out what profile the sensors are transmitting data with. For example, if it turns out to be Serial Port Profile - which is the most common one, you can literally copy and paste android chat...
I really do not understand what you mean: "I want to stop the distance sensor measurement when e.g. the sensor doesn't detect any object within 5cm(5cm being the min value set through the potentiometer)" Then left open for you to put the desired function PS: Sorry for my delay, I...
objective-c,swift,sensor,proximity
Here's my take on this. func activateProximitySensor() { let device = UIDevice.currentDevice() device.proximityMonitoringEnabled = true if device.proximityMonitoringEnabled { NSNotificationCenter.defaultCenter().addObserver(self, selector: "proximityChanged:", name: "UIDeviceProximityStateDidChangeNotification", object: device) } } func proximityChanged(notification: NSNotification) { if let device = notification.object as? UIDevice { println("\(device) detected!") } } ...