updated drift
This commit is contained in:
parent
3012068986
commit
cb816c91ad
@ -187,13 +187,13 @@ namespace sensors {
|
|||||||
// clear drift
|
// clear drift
|
||||||
this.setMode(GyroSensorMode.Rate);
|
this.setMode(GyroSensorMode.Rate);
|
||||||
this._drift = 0;
|
this._drift = 0;
|
||||||
const n = 100;
|
const n = 10;
|
||||||
let d = 0;
|
let d = 0;
|
||||||
for (let i = 0; i < n; ++i) {
|
for (let i = 0; i < n; ++i) {
|
||||||
d += this._query();
|
d += this._query();
|
||||||
pause(4);
|
pause(20);
|
||||||
}
|
}
|
||||||
this._drift = Math.round(d / n);
|
this._drift = d / n;
|
||||||
}
|
}
|
||||||
|
|
||||||
_info(): string {
|
_info(): string {
|
||||||
|
Loading…
Reference in New Issue
Block a user