Robot configuration#
Install the driver#
Copy two folders into your FTC project, under TeamCode/src/main/java/:
| Folder | What it is |
|---|---|
com/botbuilders/bbr/ |
The driver itself. Copy all of it. |
org/firstinspires/ftc/teamcode/ |
Example OpModes. Copy the ones you want. |
The com/botbuilders/bbr/ folder contains BBRDigitalExpander.java (the driver) and BBRRegMap.java (generated constants).
Do not edit BBRRegMap.java. It is generated from the register map specification, and any change you make will be overwritten the next time it is regenerated.
Add the device in the Driver Station#
On the Driver Station, in the robot configuration:
- Pick the I2C bus the Expander is wired to.
- Add a device of type “BBR Digital Expander”.
- Give it a name. The examples all use
expander. - Save the configuration and activate it.
The name you choose is the string you pass to hardwareMap:
BBRDigitalExpander exp = hardwareMap.get(BBRDigitalExpander.class, "expander");
If you name it something else, change that string in every example you copied.
Digital inputs for triggers#
If you are using digital outputs, each one also needs an entry in the robot configuration — as a Digital Device on the Hub port you wired it to, not as part of the Expander.
Name these for what they mean rather than for which pin they are on:
DigitalChannel overTarget = hardwareMap.get(DigitalChannel.class, "over_target");
What happens at init#
When your OpMode gets the device from hardwareMap, the driver checks that it is really talking to an Expander: device ID, protocol version, and reported capabilities.
If any of those are wrong it throws immediately, with a message saying which check failed. That is intentional — a clear exception during init is much easier to deal with than corrupt data halfway through a match.
This means a wiring mistake or a bad address shows up the moment you press INIT, not later.