Update calibrate.component.ts

This commit is contained in:
Zakary Timson 2019-09-02 23:34:13 -04:00 committed by GitHub
parent bc4c5f7dff
commit 67e4b8e13d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ export class CalibrateComponent {
setN() { setN() {
let currentHeading = Math.round(this.physicsService.orientation.value.alpha); let currentHeading = Math.round(this.physicsService.orientation.value.alpha);
if(currentHeading > 0) { if(currentHeading > 0) {
this.calibration = currentHeading - 360; this.calibration = currentHeading > 180 ? currentHeading - 360 : currentHeading;
} else { } else {
this.calibration = -currentHeading; this.calibration = -currentHeading;
} }