function read_compass() {
  var d = tiltfixread(CALIBDATA.offset,CALIBDATA.scale);
  heading = newHeading(d,heading);
  direction = wp_bearing - heading;
  if (direction < 0) direction += 360;
  if (direction > 360) direction -= 360;
  drawCompass(direction);
}
// Note actual mag is 360-m, error in firmware
Note actual mag is 360-m, error in firmware
Note actual mag is 360 - m error in firmware
function read_compass() {
  var d = tiltfixread(CALIBDATA.offset,CALIBDATA.scale);
  heading = newHeading(d,heading);
  direction = wp_bearing - heading;
  if (direction < 0) direction += 360;
  if (direction > 360) direction -= 360;
  drawCompass(direction);
}
function read_compass ( ) { var d = tiltfixread ( CALIBDATA . offset , CALIBDATA . scale ) ; heading = newHeading ( d , heading ) ; direction = wp_bearing - heading ; if ( direction < 0 ) direction += 360 ; if ( direction > 360 ) direction -= 360 ; drawCompass ( direction ) ; }
Note actual mag is 360-m, error in firmware
Note actual mag is 360 - m error in firmware