Sensors - Thanks! But a problem question with magnetic field sensor...
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.)
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
(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)
Thanks, this seems like a bug, I'll look into it.
I noticed that with an iPhone 5s, too.
Just chiming in that I've seen the same thing on my iPhone 5s and iPad Air.
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.