diff --git a/src/app/components/calibrate/calibrate.component.html b/src/app/components/calibrate/calibrate.component.html index eaef758..4264e0d 100644 --- a/src/app/components/calibrate/calibrate.component.html +++ b/src/app/components/calibrate/calibrate.component.html @@ -20,7 +20,7 @@
- +
diff --git a/src/app/components/calibrate/calibrate.component.ts b/src/app/components/calibrate/calibrate.component.ts index e2f09ba..0cd5eda 100644 --- a/src/app/components/calibrate/calibrate.component.ts +++ b/src/app/components/calibrate/calibrate.component.ts @@ -27,9 +27,9 @@ export class CalibrateComponent { setN() { let currentHeading = Math.round(this.physicsService.orientation.value.alpha); if(currentHeading > 0) { - this.calibration = -currentHeading; + this.calibration = currentHeading; } else { - this.calibration = 360 - currentHeading; + this.calibration = -currentHeading; } } } diff --git a/src/app/services/physics.service.ts b/src/app/services/physics.service.ts index 0219b9b..68152f8 100644 --- a/src/app/services/physics.service.ts +++ b/src/app/services/physics.service.ts @@ -52,7 +52,7 @@ export class PhysicsService { this.requireCalibration.emit(); } - info.heading = -(data[1] ? data[1].alpha : 0) - (data[2] == Infinity ? 0 : data[2]); + info.heading = -(data[1] ? data[1].alpha : 0) + (data[2] == Infinity ? 0 : data[2]); if(info.heading < 0) info.heading += 360; if(info.heading >= 360) info.heading -= 360; }