From bc4c5f7dff3df989ad616fd3c49762465929d836 Mon Sep 17 00:00:00 2001 From: Zakary Timson Date: Mon, 2 Sep 2019 23:15:19 -0400 Subject: [PATCH 1/2] Stop calibrate overflow --- src/app/components/calibrate/calibrate.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/calibrate/calibrate.component.ts b/src/app/components/calibrate/calibrate.component.ts index 0cd5eda..4b39c30 100644 --- a/src/app/components/calibrate/calibrate.component.ts +++ b/src/app/components/calibrate/calibrate.component.ts @@ -27,7 +27,7 @@ export class CalibrateComponent { setN() { let currentHeading = Math.round(this.physicsService.orientation.value.alpha); if(currentHeading > 0) { - this.calibration = currentHeading; + this.calibration = currentHeading - 360; } else { this.calibration = -currentHeading; } From 67e4b8e13d6bbda38cbd6de5ee2f89d8623c925d Mon Sep 17 00:00:00 2001 From: Zakary Timson Date: Mon, 2 Sep 2019 23:34:13 -0400 Subject: [PATCH 2/2] Update calibrate.component.ts --- src/app/components/calibrate/calibrate.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/calibrate/calibrate.component.ts b/src/app/components/calibrate/calibrate.component.ts index 4b39c30..486c08e 100644 --- a/src/app/components/calibrate/calibrate.component.ts +++ b/src/app/components/calibrate/calibrate.component.ts @@ -27,7 +27,7 @@ export class CalibrateComponent { setN() { let currentHeading = Math.round(this.physicsService.orientation.value.alpha); if(currentHeading > 0) { - this.calibration = currentHeading - 360; + this.calibration = currentHeading > 180 ? currentHeading - 360 : currentHeading; } else { this.calibration = -currentHeading; }