omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Sensors - Thanks! But a problem question with magnetic field sensor...

    Pythonista
    5
    5
    3135
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • inHishand
      inHishand last edited by

      Thanks for adding functions to access the other sensors on the iPad, but I am having trouble getting data from the mag field sensor. Is some kind of calibration required? (I have the same result on both an iPad 2 and 4, both of which work with compass apps.)

      For example:

      
      import motion
      
      motion.start_updates()
      g= motion.get_gravity()
      mag=motion.get_magnetic_field()
      acc=motion.get_user_acceleration()
      att=motion.get_attitude()
      motion.stop_updates()
      
      print g
      print mag
      print acc
      print att
      
      

      gives output:

      
      (0.10736322402954102, -0.17101316154003143, -0.9794016480445862)
      
      (0.0, 0.0, 0.0, -1)
      
      (-0.0050377873703837395, -0.00197572517208755, 0.01570233143866062)
      
      (0.10918527841567993, 0.17185789346694946, 0.004843760747462511)
      
      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        Thanks, this seems like a bug, I'll look into it.

        1 Reply Last reply Reply Quote 0
        • henryiii
          henryiii last edited by

          I noticed that with an iPhone 5s, too.

          1 Reply Last reply Reply Quote 0
          • Vaughanje
            Vaughanje last edited by

            Just chiming in that I've seen the same thing on my iPhone 5s and iPad Air.

            1 Reply Last reply Reply Quote 0
            • alport
              alport last edited by

              I have been waiting some time for a 'python' implementation to implement a routine that would access the vector value of the magnetic field on iOS devices - as opposed to just a compass heading.
              Joy to see that Pythonista offers it - but tears that it returns zero!!!
              Any chance of your looking at it soon?
              I confirm that motion.get_magneticfield() returns 0.0 on both iPad Air and iPhone 5.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors