accelerometer

Is it possible to run accelerometer of iPhone in background?

自闭症网瘾萝莉.ら 提交于 2020-01-11 15:32:45
问题 I want to use accelerometer of iPhone to get the log file of accelerometer value (maybe for 24 hours). Is it possible to let accelerometer runs in background while other applications are running? 回答1: You can do it now, if your app is allowed to run in the background for other reasons. See the Core Motion API's startAccelerometerUpdatesToQueue:withHandler: method here. 回答2: Nope, it is not. You basically can't run anything but a music app in the background. You can run the accelerometer while

Is it possible to run accelerometer of iPhone in background?

穿精又带淫゛_ 提交于 2020-01-11 15:31:10
问题 I want to use accelerometer of iPhone to get the log file of accelerometer value (maybe for 24 hours). Is it possible to let accelerometer runs in background while other applications are running? 回答1: You can do it now, if your app is allowed to run in the background for other reasons. See the Core Motion API's startAccelerometerUpdatesToQueue:withHandler: method here. 回答2: Nope, it is not. You basically can't run anything but a music app in the background. You can run the accelerometer while

Can I use smartphone accelerometer data as a weighing scale? [closed]

别来无恙 提交于 2020-01-07 09:27:08
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 months ago . Is it possible to use the raw accelerometer data from a smartphone as a weighing scale? So, by placing an object on the screen, the app would weigh the object and the weight displayed on the screen. If it is not possible, could some other function of the smartphone estimate the

finding speed of device movement

杀马特。学长 韩版系。学妹 提交于 2020-01-07 02:44:08
问题 I need to find velocity of a device(Samsung Galaxy s3). I've now read quite a lot of stackoverflow questions concerning it, but still confused as for what I should use. My observations so far: 1) Somebody did this to find velocity from accelerometer sensor's data. But in my case the device's movement will not have constant slope or straight trajectory. 2) Integration will give much drift. 3) Kalman filtering can be used but it's hard to implement and CPU consuming 4) Complementary filter can

iPhone Accelerometer direction

匆匆过客 提交于 2020-01-07 02:05:07
问题 I am developing an application in which iPhone will play different sounds when moved (sword). I want to know when iPhone has moved left, right, up or down (sword movement). How can I implement this? I was testing the accelerometer and wrote this code, but it returns the same values if moved left or right. How can I know in which direction is the iPhone moved? Code: - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration { double const kThreshold = 1

iPhone Accelerometer direction

旧街凉风 提交于 2020-01-07 02:05:06
问题 I am developing an application in which iPhone will play different sounds when moved (sword). I want to know when iPhone has moved left, right, up or down (sword movement). How can I implement this? I was testing the accelerometer and wrote this code, but it returns the same values if moved left or right. How can I know in which direction is the iPhone moved? Code: - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration { double const kThreshold = 1

Programming Arduino with ADXL345 to raise interrupt on inactivity

有些话、适合烂在心里 提交于 2020-01-06 18:01:33
问题 I need to use a sparkfun breakout board ADXL345 to detect when my motor system has stopped vibrating. I am also using a Sparkfun RedBoard (Arduino uno). Things I am doing to configure for this behavior: enable INACTIVITY event route INACTIVITY events to INT 1 (pin 2 on the RedBoard) raise INACTIVITY interrupt without delay set low threshold for INACTIVITY (rule out too high of a setting) INACTIVITY considers all axes clear interrupt data register Having done all these things I do not receive

Programming Arduino with ADXL345 to raise interrupt on inactivity

我是研究僧i 提交于 2020-01-06 18:01:27
问题 I need to use a sparkfun breakout board ADXL345 to detect when my motor system has stopped vibrating. I am also using a Sparkfun RedBoard (Arduino uno). Things I am doing to configure for this behavior: enable INACTIVITY event route INACTIVITY events to INT 1 (pin 2 on the RedBoard) raise INACTIVITY interrupt without delay set low threshold for INACTIVITY (rule out too high of a setting) INACTIVITY considers all axes clear interrupt data register Having done all these things I do not receive

CMAccelerometerData class Vs. deprecated UIAccelerometer class

与世无争的帅哥 提交于 2020-01-05 05:28:08
问题 Based on this documentation, the CMAccelerometerData class (found in the Core Motion framework) has a property of type CMAcceleration called acceleration that is a typedef of a struct containing 3 values (double x, double y, double z) I'm rather new to Objective-C (I only know C++..) so my question is this : How do I access, let's say the double y value kept in that property, at some point during my code? Do I first create an instance of the CMAccelerometerData class like this :

“Shake” app to respond at any time

家住魔仙堡 提交于 2020-01-05 05:16:06
问题 I want my app to start an activity at any time in response to a "shake" of the phone. Would it be advisable to have a service constantly running in the background that listens for a change in the accelerometer? Does anyone have any other way to do this? There are plenty of apps that do this kind of thing. 回答1: Yes, using a service would be the way to go, since your app needs to be running for the SensorEventListener to work. Check out this answer for some code on how to implement a