Vision Sensor (WRO Edition, HUE12) × mBlock 5 (Makeblock edition)
Back to Vision Sensor (WRO Edition, HUE12)
The Makeblock edition of the Vision Sensor (WRO Edition, HUE12) plugs into an RJ25 port on mBot, Ranger, Orion or MegaPi and is read with the MBC Pro Sensors extension v2 blocks. Installation and usable ports per board: Makeblock extension.
SPIKEEV3Arduino I2CmBlockMATRIXmicro:bit
Wiring
Sensor → mBot adapter → RJ25 port on the board (S1 = host TX, S2 = host RX). UART 38400 8N1.
Reporter blocks
| Block | Returns | Id | Meaning |
|---|---|---|---|
| SharpShot Vision WRO (legacy) port [port] spot [1~12] colour code | 0~255 | 10~1B |
10 |
| SharpShot Vision WRO (legacy) port [port] spot [1~12] vividness | 0~255 | 20~2B |
20 |
Command blocks
| Block | Id | Meaning |
|---|---|---|
| SharpShot Vision WRO (legacy) port [port] update all values | FD |
reads the whole value table into a cache (FD pack-all); reporter blocks within the next 10 ms use the cache instead of asking one by one |
Status blocks
The extension exposes each F3 bit as a boolean block:
| bit | Name | Meaning |
|---|---|---|
| b0 | ready (ready) |
always 1; b1 = 0 (the WRO edition has no 'blob found') |
Packet format (for your own decoder)
| Action | Format |
|---|---|
| Read one value | 主機送 [編號] → 回 [值低][值高][編號^值低^值高] |
| Write command | 寫入命令 E0~EE:收齊參數後回 [00][00][編號] 再執行;20 ms 內沒收齊就丟棄 |
| Unknown id | [00][80][編號^0x80](= -32768) |
| Pack all (FD) | Send [FD] → reply [AA][18][24 × int16 LE][xor], xor = AA ^ N ^ all data bytes; content = this value table in ascending id order (shared ids and commands excluded). The extension fetches it once and serves blocks from a 10 ms cache. |
| Shared ids | F0 device ID, F1 protocol version, F2 firmware version, F3 status flags |
Sources and assumptions
Generated by _build/gen-reference.mjs from _build/protocol/cam_wro.json (single source of truth, transcribed from the 2026-10-21 protocol decisions).
- hw0 = 2(共識 #6:神攝手 2 = WRO 版);model = HUE12(樂高模式名)。
- I2C 0x4C 與學校版同一位址(主機用 F0 高 byte 1/2 分辨);D4:SDA = IO3、SCL = IO1,與 EV3/SPIKE 串口模式二選一編譯;ESP32 從機 onReceive 預載 32 B;上機待測。mBlock 用 Serial.begin(38400, SERIAL_8N1, 3, 1)。
- 值表只有 10
1B、202B(mBlock 定案);兩群各 12 個,I2C 一次連續讀 12 個值(24 B)剛好一群。 - EV3/SPIKE 只有一個模式 HUE12(type 95,動態描述表 DATA32×8),鎖住照盤點 §0-2 排法;沒有 ID 模式(type 95 只宣告 1 個模式,不加)。
- mVision 鎖住照盤點 §4:[0xAA][9][18 B][xor],byte 0
11 顏色碼、1217 鮮豔度 4 bit;WRO 隊伍的 HUE12_AS_mVisionSensor_v1.0.8.mbr4 在用,不動;B-6:不節流(每圈 loop 送)。 - mVision 的鮮豔度是 S>>4(0
15),值表 202B 是完整 0~255;兩者不同是既有設計,不改。 - 顏色碼 255 只代表「色點沒開」,不代表「沒找到」(沒抓到時仍回種子點顏色,盤點 §0-1)。
- 不做 0x22(hosts.matrix = false);沒有寫入命令;F3 只有 b0。
- Block wording follows the v2.0.0 extension generator
build_mext.js; this page is generated from the same JSON.