Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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);
Source by www.w3.org #
 
PREVIOUS NEXT
Tagged: #calculate #north #south #east #west #magnetic #sensor
ADD COMMENT
Topic
Name
6+2 =