This page has moved into the new guide: IMU 9-Axis Gyro › MATRIX › MATRIXblock stock blocks

IMU Gyro Sensor × MATRIX Mini R4

Back to IMU Gyro Sensor

The MATRIX edition of the IMU Gyro Sensor plugs into a Mini R4 I2C port at address 0x22 and is read with the stock colour-sensor blocks: no library change, RK = seven 0255 numbers.

SPIKEEV3Arduino I2CmBlockMATRIXmicro:bit

Wiring

IMU Gyro Sensor × MATRIX Mini R4

Use the stock MATRIX 4-pin sensor cable on I2C1 or I2C2 and pick that port in the block.

A. Stock blocks (0x22)

The "colour sensor → R / G / B / C / M / Y / K" blocks each return one 0~255 number. ⚠️ Do not use the stock H / S / V or colour-ID blocks (the host computes them from R, G, B; meaningless here); the grayscale and colour-number blocks were removed by MATRIX.

Block Content Decode
R gyro 3D heading 1~2 R = (航向+32768) 低 byte、G = 高 byte(R4 版:低在前);主機 hi×256+lo−32768
G gyro 3D heading 3~4 R = (航向+32768) 低 byte、G = 高 byte(R4 版:低在前);主機 hi×256+lo−32768
B fused heading 1~2 B = 低 byte、C = 高 byte
C fused heading 3~4 B = 低 byte、C = 高 byte
M gyro 1D heading 1~2 M = 低 byte、Y = 高 byte;K(10)= 0
Y gyro 1D heading 3~4 M = 低 byte、Y = 高 byte;K(10)= 0
// MATRIXblock → Arduino:stock library
int r = MiniR4.I2C1.MXColor.getColor(R);   // gyro 3D heading  1~2

Sources and assumptions

Generated by _build/gen-reference.mjs from _build/protocol/imu.json (single source of truth, transcribed from the 2026-10-21 protocol decisions).

  • hw0 = 1(共識 #6);EV3 模式 4 = [0x6A | 1<<8, 韌體主×100+次, 0, 0](格式 B 再補 2 個 0),模式 5 改送俯仰角速度(取代 #65 放的 ID)。
  • EV3 鎖住模式 0/1/3 照盤點程式碼:0 = 陀螺 3D、1 = 融合航向、3 = [陀螺 1D, 磁力航向](INO:213 註解寫反,以程式為準)。
  • 0x22 照 R4 版(出貨版)鎖住:命令 49 = 三個航向 +32768 的「低 byte 在前、高 byte 在後」;盤點檔分析的是主韌體(高在前),主韌體 #67 改成跟 R4 版逐 byte 相同。命令 1012 = 0;0x01、0x0A、0x0F、F1~F4 都觸發航向歸零(刻意,不動)。
  • B-13:E1~E4 加速度計/磁力計校準開始/結束補回(v1 的 0x20 = 01/02/03/04),I2C 定案 §3 只列 E0。busyFlag:E1 → b4、E3 → b5。
  • 俯仰角範圍定案沒寫(韌體尚無現成值,#67 用 atan2 新算),range 先填「°」不給 min/max,韌體做好後再補。
  • 磁力信任度 08 = round(trust×255),磁場干擾度 09 = round(disturbance×100) 上限 255,朝上的面 0A = 軸號 + 3×負向:公式照盤點 I2C v1 0x34~0x36。
  • 角速度 1012 = round(dps×SIGN×10)、加速度 1315 = mm/s²×1000/9806.65、磁力 1618 = raw×SIGN×4/15:公式照盤點 I2C v1 0x220x24;mBlock 一併有(I2C 定案 §4 共用值表)。
  • 主對話 2026-10-22:06 俯仰角範圍 −90~+90、07 = gyro X(照字面),取自 F5 韌體實作。
Email for a quoteBuying Guide