CPC G01R 33/0206 (2013.01) [G01R 33/0082 (2013.01)] | 17 Claims |
1. An electronic device comprising:
a memory,
a geomagnetic sensor, and
at least one processor configured to:
store, in the memory, a temperature of each of a plurality of heating areas included in the electronic device and a variation in a geomagnetic value sensed by the geomagnetic sensor, corresponding to the temperature,
perform linear fitting using the temperature and the variation in the geomagnetic value stored in the memory,
compute an error between the variation in the geomagnetic value and an estimated value for the variation in the geomagnetic value, based on a result of the linear fitting,
determine a scheme for compensating for the geomagnetic value based on the computed error, and
compensate for the geomagnetic value sensed by the geomagnetic sensor using the determined scheme when a variation in temperature is detected for at least one heating area in the plurality of heating areas,
wherein the at least one processor is further configured to, when an acceleration value sensed by the acceleration sensor is a predesignated value or less, sense the temperature and the variation in the geomagnetic value and store the temperature and the variation in the geomagnetic value in the memory.
|