Class WsContinuousI2CInputConfig
java.lang.Object
org.wildstang.hardware.roborio.inputs.config.WsI2CInputConfig
org.wildstang.hardware.roborio.inputs.config.WsContinuousI2CInputConfig
- All Implemented Interfaces:
InputConfig
- Direct Known Subclasses:
WsLidarInputConfig
Wrapper class to identify hall effect sensors separate from I2C inputs.
-
Constructor Summary
ConstructorsConstructorDescriptionWsContinuousI2CInputConfig(edu.wpi.first.wpilibj.I2C.Port port, int address) Construct the hall effect sensor config with the default update interval (20 ms).WsContinuousI2CInputConfig(edu.wpi.first.wpilibj.I2C.Port port, int address, int updateInterval) Construct the hall effect sensor config. -
Method Summary
Modifier and TypeMethodDescriptionintReturn the update interval in ms.toString()Builds a JSON String describing the I2C input config.Methods inherited from class org.wildstang.hardware.roborio.inputs.config.WsI2CInputConfig
getAddress, getPort
-
Constructor Details
-
WsContinuousI2CInputConfig
public WsContinuousI2CInputConfig(edu.wpi.first.wpilibj.I2C.Port port, int address) Construct the hall effect sensor config with the default update interval (20 ms).- Parameters:
port- Hardware port number the sensor is connected to.address- I2C address of the sensor.
-
WsContinuousI2CInputConfig
public WsContinuousI2CInputConfig(edu.wpi.first.wpilibj.I2C.Port port, int address, int updateInterval) Construct the hall effect sensor config.- Parameters:
port- Hardware port number the sensor is connected to.address- I2C address of the sensor.updateInterval- Number of milliseconds between updates.
-
-
Method Details
-
getUpdateInterval
public int getUpdateInterval()Return the update interval in ms.- Returns:
- The update interval in ms.
-
toString
Builds a JSON String describing the I2C input config.- Overrides:
toStringin classWsI2CInputConfig- Returns:
- Channel number, address, and update interval.
-