What you have#
What’s on the board#
Every board is the same. There is one version, and it has everything:
| 4 encoder inputs | Quadrature, or pulse-width absolute |
| 4 sensor ports | Colour or distance, any mix |
| 4 digital outputs | Driven by the board itself |
| Gyro / heading | Onboard, six-axis |
| Field pose (x, y, heading) | With two dead-wheel encoders |
If a heading or pose call throws an exception, that means the board cannot give you a trustworthy answer — a gyro that isn’t responding, or one that hasn’t settled yet. It throws rather than returning zero on purpose: a heading of 0.00 that never changes looks exactly like working software right up until the match, whereas an exception tells you the truth immediately. See Troubleshooting.
Ports and numbering#
Everything is numbered 0 to 3, and each group is numbered independently:
- Encoder channels 0–3 — quadrature by default; each can be switched to read a pulse-width (PWM) absolute encoder instead.
- Sensor ports 0–3 — each takes a colour or a distance sensor. Any mix is fine, including four of the same kind.
- Digital outputs 0–3 — driven by the board, read by the Hub as ordinary digital inputs.
Sensor port 2 has nothing to do with encoder channel 2 or digital output 2. They are separate things that happen to share a numbering scheme.
Supported sensors#
| Sensor | Kind | What you get |
|---|---|---|
| APDS-9151 | Colour | Colour classification, raw R/G/B/IR, proximity |
| VL53L0X | Distance | Range in millimetres, signal quality |
The board detects which kind of sensor is on each port by itself — there is nothing to configure. Ask it what it found:
exp.getSensorType(0); // COLOR, DISTANCE, or EMPTY
exp.isSensorConnected(0); // true while a sensor is detected
Colour slots#
Each sensor port can remember up to 7 colours, numbered 1 to 7. You teach them by example — hold something in front of the sensor and tell the board “that is colour 1”.
Slot 7 is used internally by the triggerWhenNear() helper on distance ports. If you use that helper, keep your taught colours in slots 1–6 on that port so nothing collides.
What the board needs from you#
- An I2C port on the Control Hub or Expansion Hub. The board appears at 7-bit address
0x38. - Power, supplied over the same connection.
- A digital input port on the Hub for each digital output you want to read — only if you use the standalone trigger feature.
All four sensor ports share the one I2C connection to the Hub. The board handles the switching internally, so four sensors cost you one Hub port, not four.