Answers for "calculate north south east west using magnetic sensor"

0

calculate north south east west using magnetic sensor

let sensor = new Magnetometer();
sensor.start();
let heading = Math.atan2(sensor.y, sensor.x) * (180 / Math.PI);
console.log('Heading in degrees: ' + heading);
Posted by: Guest on September-07-2021

Browse Popular Code Answers by Language