facebook

Reading iPhone magnetometer data

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #349479 Reply

    Does anyone know how to use MobiOne to gain access to the iPhone’s internal magnetometer X, Y, Z axis data?

    I am trying to write an app that display’s X, Y, and Z axis data, but cannot find anything that is actually useful. I did find stuff related to the accelerometer, but nothing on the magnetometer. I have also found references that talk about how polling the accelerometer and magnetometer are similar, but they did not give any details, so that was not helpful at all!!!

    I am using the following ….

    0) MobiOne v2.6.2 (20140109)

    1) Windows OS version (XP Professional SP3)

    2) I am writing in Native iOS Mode for an iPhone 5, Device OS is 6 and 7

    Can anyone tell me how to easily read the individual X, Y, and Z axis values of the iPhones magnetometer?

    Thanks,

    Mike

    #349481 Reply

    Hi Mike,

    Have you taken a look at the compass API? If no, you can find it here: http://docs.phonegap.com/en/2.9.0/cordova_compass_compass.md.html#Compass

    #349494 Reply

    Octavio –

    Yes, I did read through this, but the problem is that this only gives a result of a single value from 0 to 360 (359.99) degrees.

    The compass is a sensor that detects the direction or heading that the device is pointed. It measures the heading in degrees from 0 to 359.99.

    What I am looking for is the X, Y, and Z axis data from the magnetometer, and not the single heading value.

    Can you tell me how to access the raw X, Y, Z axis data from the iPhone magnetometer? I will be happy with only the iPhone 5S for now, but I hope to expand it.

    Mike

    #349495 Reply

    Octavio –

    By the way, I did find this related to the iOS Developer Library (CMMotionManager), but I don’t know how to apply this using Mobione. I think this is xcode related, so I am unsure how to utilize this.

    https://developer.apple.com/library/IOS/documentation/CoreMotion/Reference/CMMotionManager_Class/Reference/Reference.html#//apple_ref/occ/instp/CMMotionManager/magnetometerUpdateInterval

    Mike

    #349501 Reply

    Hi Mike,

    I have consulted the dev team and I learned that MobiOne does not provide the lower level of api support you are seeking.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Reading iPhone magnetometer data

You must be logged in to post in the forum log in