This page has moved into the new guide: Ranger 8-Way › MATRIX › MATRIXblock stock blocks

Laser Ranger 8-ch × MATRIX Mini R4

Back to Laser Ranger 8-ch

The MATRIX edition of the Laser Ranger 8-ch 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

Laser Ranger 8-ch × 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 sensor 1~8 distance (cm) 1~2 #67 改(使用者最終定案):R、G、B = 第 1、2、3 顆;C = min(第 4, 第 5 顆)(正前方取較近);M、Y、K = 第 6、7、8 顆;全部 cm 0~120;11、12 = 0
G sensor 1~8 distance (cm) 3~4 #67 改(使用者最終定案):R、G、B = 第 1、2、3 顆;C = min(第 4, 第 5 顆)(正前方取較近);M、Y、K = 第 6、7、8 顆;全部 cm 0~120;11、12 = 0
B sensor 1~8 distance (cm) 5~6 #67 改(使用者最終定案):R、G、B = 第 1、2、3 顆;C = min(第 4, 第 5 顆)(正前方取較近);M、Y、K = 第 6、7、8 顆;全部 cm 0~120;11、12 = 0
C sensor 1~8 distance (cm) 7~8 #67 改(使用者最終定案):R、G、B = 第 1、2、3 顆;C = min(第 4, 第 5 顆)(正前方取較近);M、Y、K = 第 6、7、8 顆;全部 cm 0~120;11、12 = 0
M sensor 1~8 distance (cm) 9~10 #67 改(使用者最終定案):R、G、B = 第 1、2、3 顆;C = min(第 4, 第 5 顆)(正前方取較近);M、Y、K = 第 6、7、8 顆;全部 cm 0~120;11、12 = 0
Y sensor 1~8 distance (cm) 11~12 #67 改(使用者最終定案):R、G、B = 第 1、2、3 顆;C = min(第 4, 第 5 顆)(正前方取較近);M、Y、K = 第 6、7、8 顆;全部 cm 0~120;11、12 = 0
K sensor 1~8 distance (cm) 13~14 #67 改(使用者最終定案):R、G、B = 第 1、2、3 顆;C = min(第 4, 第 5 顆)(正前方取較近);M、Y、K = 第 6、7、8 顆;全部 cm 0~120;11、12 = 0
// MATRIXblock → Arduino:stock library
int r = MiniR4.I2C1.MXColor.getColor(R);   // sensor 1~8 distance (cm)  1~2

Sources and assumptions

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

  • 正前方 mm(EV3 模式 3、SPIKE 模式 6 v[1])在定案 §5 沒有獨立 I2C 編號 → 掛在 05 正前方 cm 底下,用 scale:mm 標示,不自己加編號。
  • 0x22(使用者 2026-10-21 最終定案):只用一個位址,R~K 由左到右 7 個 cm:第 1、2、3 顆、min(第 4, 第 5)、第 6、7、8 顆;11、12 不放資料;最近距離/方向由主機自己比較。此排法只用在 0x22,EV3/SPIKE不動。
  • SPIKE:0/5/7/9 鎖住,1、2、3、4、8 維持不動;模式 6 改 [最近 mm, 正前方 mm, 最近方向 −8+8](原本 = 第 27 顆兩兩合併);模式 8 v[0] 改 ID|hw[0]<<8。
  • 最空曠方向 04 範圍 −7~+7(maxDirection 永遠不會是 0/16,盤點 INO:1086-1088);最近方向 02 ±8 = 沒目標、沿用上次偏向側,開機預設 −8。
  • 沒有寫入命令;F8 換位址/EF 重開機用共用的。
  • 主對話 2026-10-21:補 09 正前方 mm(定案 §5 只有 05 正前方 cm,但 EV3 模式 3、SPIKE 模式 6 都送 mm,I2C/mBlock 應有同一個值)。
Email for a quoteBuying Guide