From cb816c91ada333babe4e12ea9b05fdf611f93bc9 Mon Sep 17 00:00:00 2001 From: Peli Date: Mon, 30 Sep 2019 14:33:57 -0700 Subject: [PATCH] updated drift --- libs/gyro-sensor/gyro.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/gyro-sensor/gyro.ts b/libs/gyro-sensor/gyro.ts index fc88bc02..8b91d777 100644 --- a/libs/gyro-sensor/gyro.ts +++ b/libs/gyro-sensor/gyro.ts @@ -187,13 +187,13 @@ namespace sensors { // clear drift this.setMode(GyroSensorMode.Rate); this._drift = 0; - const n = 100; + const n = 10; let d = 0; for (let i = 0; i < n; ++i) { d += this._query(); - pause(4); + pause(20); } - this._drift = Math.round(d / n); + this._drift = d / n; } _info(): string {