Skip to content

QMI8658 IMU

QMI8658 is a six-axis IMU. The game mainly uses gravity for 2D tilt, while driver initialization and axes remain locked to board documentation.

Axis correction

The first pass sent sensor X/Y directly to screen X/Y, but the chip is rotated 90° relative to the display. Four-way physical tests established:

cpp
screen_x = -(sensor_y - neutral_y);
screen_y = +(sensor_x - neutral_x);

This is a board-adaptation rule rather than generic game math. Web simulation already uses screen coordinates.

Sampling and normalization

  • 33 ms task period.
  • I²C address 0x6B.
  • Stable-window neutral rather than one sample.
  • 0.025 g dead zone.
  • 0.55 g maps to normalized 1.0.
  • Low-pass output clamped to -1…1.
  • UI reads a snapshot and never blocks on I²C.

Wake calibration

Ambient retains the mean of five recent physical samples. Touch-down wake freezes that pre-contact posture as the new neutral and consumes the full touch. One-shot device QA reported fallback=0, roughly 160 ms completion and final tilt=0,0.

Visual response

QMI8658 tilt response

INTEGER PIXEL BANDS

The 160×160 Seed redraws in bands. LOW/MID/HIGH cap travel at 3/2, 6/4 and 10/7 px with shear 2/4/7, preserving 2×2 texels.

Automated validation

Host tests cover arbitrary initial posture, four-way signs, axis isolation, dead zone, full scale, filtering, recalibration, moving-sample rejection and immediate snapshot. The visual validator covers 750 HIGH poses. Subjective depth and HIGH preference remain human judgments.