Programming
Driver Installation
You can find the Java driver for the SRSHub on our GitHub repository. Simply copy the file into your teamcode
package, and you’re ready to use the SRS Hub in your codebase!
HardwareMap
Configuration
Once you have added the java file to your teamcode
package:
- Upload your code to the REV Hub, in whatever way you typically do that (ADB, USB, etc.), so that the
HardwareMap
device options are updated to include the SRSHub. - Configure your
HardwareMap
: navigate to the control hub’s I2C device list in theHardwareMap
configuration menu, and add the SRSHub to the correct port on the Control Hub, making sure to selectSRSHub
as the device type.
REV Hub Reading Configuration
To get the most performance, you should disable bulk reads on both the Control Hub and Expansion Hub using the below code:
The SRSHub should have enough ports for most teams, but if you find youself needing to read the control hub, you can run the below code at the end of the main loop:
Example Usage
Below is a sample OpMode that uses the SRSHub to read a variety of sensors: