Questions tagged [devicemotion]

72 questions
0
votes
0 answers

SWIFT: Changing view controllers with CMDeviceMotion

I am following this article: http://nshipster.com/cmdevicemotion/ On how to use CMDeviceMotion. They named this part of the article: Keep It To Yourself I made a viewcontroller with a identifier called: PromptViewController. I get an error: Use of…
0
votes
1 answer

How can I get magnetometer values with xamarin using the Device Motion Plugin?

I try to get the magnetic field data for a crossplateform application developped by xamarin. I am quite beginner with mobile developpement especially Xamarin. So I have the Hello Word code: public App () { // The root page of…
dou
  • 293
  • 2
  • 3
  • 14
0
votes
0 answers

How to detect last device motion event using javascript?

Good day all, I am trying to capture the values of accelerationIncludingGravity in javascript just before it stops generating any more, that is, when the device is stationary. I know that there is an event called motionEnded generated in Xcode to…
sb_ykz61m
  • 1
  • 4
0
votes
0 answers

iOS CoreMotion DeviceMotion Gravity Angles

I noticed the values returned by the gravity.z component seem to follow a cosine curve: gravity.z = 0 = cos(90) (iPhone in portrait mode) gravity.z = -.707 = cos(45) (iPhone tilted back by 45 degrees) gravity.z = -1 = cos(0) (iPhone…
Oak
  • 165
  • 2
  • 14
0
votes
0 answers

CoreMotion how can I play music while user jumps up and down?

I'm coding an iOS app in Swift, I need to play music while the user is jumping up and down (detected via coreMotion). Playing the audio is fine, But I do not know how to trigger/stop the music using coreMotion. Any help would be greatly appreciated!…
Spudcakez
  • 1
  • 1
0
votes
1 answer

html5 devicemotion acceleration always changes

I develop a web application and want to use the devicemotion event to get the acceleration to measure the speed and the distance but i noticed that even the device is static on a flat surface the acceleration values on y and always change. var…
Mohamed
  • 337
  • 3
  • 18
0
votes
1 answer

How can I get horizontal rotation angle whatever device orientation?

I can get horizontal rotation angle by calculating the roll value (according to the definition of iOS Device Motion) when the device is portrait. The x, y, z-axis of the mobile device: But when the device is in landscape, y-axis is horizontal and…
Vincent
  • 141
  • 1
  • 2
  • 15
0
votes
1 answer

Finding the current Accelerometer values

I'm trying to get a label to rotate based on the tit of the device in an app I'm making in swift. Given that I should be fine with rotating the label, does anybody know how to find the current accelerometer values of an iPhone? For example, getting…
Matt Spoon
  • 2,760
  • 5
  • 25
  • 41
0
votes
1 answer

How to use FFTW on deviceMotion.userAcceleration.x

I am working on an app. that its measuring the motion of a device. (xyz direction ) and now i must use fftw to filter the data. i don't know how to call the data through fftw. hier below is a part of my code trying to execute the X-data ( i am…
josef
  • 1,632
  • 1
  • 11
  • 16
0
votes
0 answers

Find distance using accleremoter, gyroscope and Device motion and also use double integration

I want to calculate the distance from one point to another point, when I start capturing accelerometer data, and till I stop that, it should gather all samples and should give me distance based on velocity, roll, pitch, yaw and displacement. I have…
Dipen
  • 268
  • 1
  • 14
-1
votes
2 answers

Not able to remove device motion event listener

In ionic 3 not able to remove device motion event listener. If any solution for this? window.addEventListener("devicemotion", (evt)=>{ if(evt.acceleration.x > 10){ window.removeEventListener("devicemotion"); } } Refered link :…
Jose G Varanam
  • 767
  • 8
  • 19
-2
votes
1 answer

Track iOS Device Motion Updates in Background for more than 10 minutes

I have an app which checks the gravity of the iPhone every second in the background. When I run this code while connected to Xcode, the program runs for more than 30 minutes in the background. However, when it is not connected to Xcode, it stop…
Maanit
  • 316
  • 2
  • 4
  • 14
1 2 3 4
5