mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[hal,wpilib] Remove MXP mentions in API docs (NFC) (#8694)
This commit is contained in:
@@ -15,10 +15,9 @@ public class I2CJNI extends JNIWrapper {
|
||||
/**
|
||||
* Initializes the I2C port.
|
||||
*
|
||||
* <p>Opens the port if necessary and saves the handle. If opening the MXP port, also sets up the
|
||||
* channel functions appropriately.
|
||||
* <p>Opens the port if necessary and saves the handle.
|
||||
*
|
||||
* @param port The port to open, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The port to open.
|
||||
* @see "HAL_InitializeI2C"
|
||||
*/
|
||||
public static native void i2CInitialize(int port);
|
||||
@@ -29,7 +28,7 @@ public class I2CJNI extends JNIWrapper {
|
||||
* <p>This is a lower-level interface to the I2C hardware giving you more control over each
|
||||
* transaction.
|
||||
*
|
||||
* @param port The I2C port, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The I2C port.
|
||||
* @param address The address of the register on the device to be read/written.
|
||||
* @param dataToSend Buffer of data to send as part of the transaction.
|
||||
* @param sendSize Number of bytes to send as part of the transaction.
|
||||
@@ -52,7 +51,7 @@ public class I2CJNI extends JNIWrapper {
|
||||
* <p>This is a lower-level interface to the I2C hardware giving you more control over each
|
||||
* transaction.
|
||||
*
|
||||
* @param port The I2C port, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The I2C port.
|
||||
* @param address The address of the register on the device to be read/written.
|
||||
* @param dataToSend Buffer of data to send as part of the transaction.
|
||||
* @param sendSize Number of bytes to send as part of the transaction.
|
||||
@@ -74,7 +73,7 @@ public class I2CJNI extends JNIWrapper {
|
||||
*
|
||||
* <p>Writes a single byte to a register on a device and wait until the transaction is complete.
|
||||
*
|
||||
* @param port The I2C port, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The I2C port.
|
||||
* @param address The address of the register on the device to be written.
|
||||
* @param dataToSend The byte to write to the register on the device.
|
||||
* @param sendSize Number of bytes to send.
|
||||
@@ -88,7 +87,7 @@ public class I2CJNI extends JNIWrapper {
|
||||
*
|
||||
* <p>Writes a single byte to a register on a device and wait until the transaction is complete.
|
||||
*
|
||||
* @param port The I2C port, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The I2C port.
|
||||
* @param address The address of the register on the device to be written.
|
||||
* @param dataToSend The byte to write to the register on the device.
|
||||
* @param sendSize Number of bytes to send.
|
||||
@@ -103,7 +102,7 @@ public class I2CJNI extends JNIWrapper {
|
||||
* <p>Reads bytes from a device. Most I2C devices will auto-increment the register pointer
|
||||
* internally allowing you to read consecutive registers on a device in a single transaction.
|
||||
*
|
||||
* @param port The I2C port, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The I2C port.
|
||||
* @param address The register to read first in the transaction.
|
||||
* @param dataReceived A ByteBuffer to store the data read from the device.
|
||||
* @param receiveSize The number of bytes to read in the transaction.
|
||||
@@ -119,7 +118,7 @@ public class I2CJNI extends JNIWrapper {
|
||||
* <p>Reads bytes from a device. Most I2C devices will auto-increment the register pointer
|
||||
* internally allowing you to read consecutive registers on a device in a single transaction.
|
||||
*
|
||||
* @param port The I2C port, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The I2C port.
|
||||
* @param address The register to read first in the transaction.
|
||||
* @param dataReceived A byte array to store the data read from the device.
|
||||
* @param receiveSize The number of bytes to read in the transaction.
|
||||
@@ -131,7 +130,7 @@ public class I2CJNI extends JNIWrapper {
|
||||
/**
|
||||
* Closes an I2C port.
|
||||
*
|
||||
* @param port The I2C port, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The I2C port.
|
||||
* @see "HAL_CloseI2C"
|
||||
*/
|
||||
public static native void i2CClose(int port);
|
||||
|
||||
@@ -22,9 +22,8 @@ extern "C" {
|
||||
* Initializes the I2C port.
|
||||
*
|
||||
* Opens the port if necessary and saves the handle.
|
||||
* If opening the MXP port, also sets up the channel functions appropriately.
|
||||
*
|
||||
* @param[in] port The port to open, 0 for the on-board, 1 for the MXP.
|
||||
* @param[in] port The port to open.
|
||||
* @param[out] status Error status variable. 0 on success.
|
||||
*/
|
||||
void HAL_InitializeI2C(HAL_I2CPort port, int32_t* status);
|
||||
@@ -35,7 +34,7 @@ void HAL_InitializeI2C(HAL_I2CPort port, int32_t* status);
|
||||
* This is a lower-level interface to the I2C hardware giving you more control
|
||||
* over each transaction.
|
||||
*
|
||||
* @param port The I2C port, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The I2C port.
|
||||
* @param deviceAddress The address of the register on the device to be
|
||||
* read/written.
|
||||
* @param dataToSend Buffer of data to send as part of the transaction.
|
||||
@@ -54,7 +53,7 @@ int32_t HAL_TransactionI2C(HAL_I2CPort port, int32_t deviceAddress,
|
||||
* Writes a single byte to a register on a device and wait until the
|
||||
* transaction is complete.
|
||||
*
|
||||
* @param port The I2C port, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The I2C port.
|
||||
* @param deviceAddress The address of the register on the device to be
|
||||
* written.
|
||||
* @param dataToSend The byte to write to the register on the device.
|
||||
@@ -71,7 +70,7 @@ int32_t HAL_WriteI2C(HAL_I2CPort port, int32_t deviceAddress,
|
||||
* Most I2C devices will auto-increment the register pointer internally allowing
|
||||
* you to read consecutive registers on a device in a single transaction.
|
||||
*
|
||||
* @param port The I2C port, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The I2C port.
|
||||
* @param deviceAddress The register to read first in the transaction.
|
||||
* @param count The number of bytes to read in the transaction.
|
||||
* @param buffer A pointer to the array of bytes to store the data read from the
|
||||
@@ -84,7 +83,7 @@ int32_t HAL_ReadI2C(HAL_I2CPort port, int32_t deviceAddress, uint8_t* buffer,
|
||||
/**
|
||||
* Closes an I2C port
|
||||
*
|
||||
* @param port The I2C port, 0 for the on-board, 1 for the MXP.
|
||||
* @param port The I2C port.
|
||||
*/
|
||||
void HAL_CloseI2C(HAL_I2CPort port);
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -31,8 +31,7 @@ class {{ name }} : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a {{ DisplayName }} connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the {{ DisplayName }} is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the {{ DisplayName }} is attached to.
|
||||
*/
|
||||
explicit {{ name }}(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class Koors40 : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a Koors40 connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the Koors40 is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the Koors40 is attached to.
|
||||
*/
|
||||
explicit Koors40(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class PWMSparkFlex : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a SPARK Flex connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the SPARK Flex is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the SPARK Flex is attached to.
|
||||
*/
|
||||
explicit PWMSparkFlex(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class PWMSparkMax : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a SPARK MAX connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the SPARK MAX is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the SPARK MAX is attached to.
|
||||
*/
|
||||
explicit PWMSparkMax(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class PWMTalonFX : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a Talon FX connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the Talon FX is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the Talon FX is attached to.
|
||||
*/
|
||||
explicit PWMTalonFX(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class PWMTalonSRX : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a Talon SRX connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the Talon SRX is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the Talon SRX is attached to.
|
||||
*/
|
||||
explicit PWMTalonSRX(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class PWMVenom : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a Venom connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the Venom is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the Venom is attached to.
|
||||
*/
|
||||
explicit PWMVenom(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class PWMVictorSPX : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a Victor SPX connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the Victor SPX is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the Victor SPX is attached to.
|
||||
*/
|
||||
explicit PWMVictorSPX(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class Spark : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a SPARK connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the SPARK is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the SPARK is attached to.
|
||||
*/
|
||||
explicit Spark(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class SparkMini : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a SPARKMini connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the SPARKMini is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the SPARKMini is attached to.
|
||||
*/
|
||||
explicit SparkMini(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class Talon : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a Talon connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the Talon is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the Talon is attached to.
|
||||
*/
|
||||
explicit Talon(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class VictorSP : public PWMMotorController {
|
||||
/**
|
||||
* Constructor for a Victor SP connected via PWM.
|
||||
*
|
||||
* @param channel The PWM channel that the Victor SP is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the Victor SP is attached to.
|
||||
*/
|
||||
explicit VictorSP(int channel);
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ class AnalogInput : public wpi::util::Sendable,
|
||||
/**
|
||||
* Construct an analog input.
|
||||
*
|
||||
* @param channel The channel number on the roboRIO to represent. 0-3 are
|
||||
* on-board 4-7 are on the MXP port.
|
||||
* @param channel The SmartIO channel to use.
|
||||
*/
|
||||
explicit AnalogInput(int channel);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class DigitalInput : public wpi::util::Sendable,
|
||||
*
|
||||
* Creates a digital input given a channel.
|
||||
*
|
||||
* @param channel The DIO channel 0-9 are on-board, 10-25 are on the MXP port
|
||||
* @param channel The SmartIO channel
|
||||
*/
|
||||
explicit DigitalInput(int channel);
|
||||
|
||||
|
||||
@@ -27,8 +27,7 @@ class DigitalOutput : public wpi::util::Sendable,
|
||||
*
|
||||
* Create a digital output given a channel.
|
||||
*
|
||||
* @param channel The digital channel 0-9 are on-board, 10-25 are on the MXP
|
||||
* port
|
||||
* @param channel The SmartIO channel
|
||||
*/
|
||||
explicit DigitalOutput(int channel);
|
||||
|
||||
|
||||
@@ -51,8 +51,7 @@ class PWM : public wpi::util::Sendable, public wpi::util::SendableHelper<PWM> {
|
||||
* The allocation is only done to help users ensure that they don't double
|
||||
* assign channels.
|
||||
*
|
||||
* @param channel The PWM channel number. 0-9 are on-board, 10-19 are on the
|
||||
* MXP port
|
||||
* @param channel The SmartIO channel number.
|
||||
* @param registerSendable If true, adds this instance to SendableRegistry
|
||||
*/
|
||||
explicit PWM(int channel, bool registerSendable = true);
|
||||
|
||||
@@ -92,11 +92,10 @@ class PWMMotorController
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Constructor for a PWM Motor %Controller connected via PWM.
|
||||
* Constructor for a PWM Motor Controller connected via PWM.
|
||||
*
|
||||
* @param name Name to use for SendableRegistry
|
||||
* @param channel The PWM channel that the controller is attached to. 0-9 are
|
||||
* on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel that the controller is attached to.
|
||||
*/
|
||||
PWMMotorController(std::string_view name, int channel);
|
||||
|
||||
|
||||
@@ -34,9 +34,7 @@ class AnalogPotentiometer
|
||||
* This will calculate the result from the fullRange times the fraction of the
|
||||
* supply voltage, plus the offset.
|
||||
*
|
||||
* @param channel The Analog Input channel number on the roboRIO the
|
||||
* potentiometer is plugged into. 0-3 are on-board and 4-7
|
||||
* are on the MXP port.
|
||||
* @param channel The SmartIO channel this potentiometer is plugged into.
|
||||
* @param fullRange The value (in desired units) representing the full
|
||||
* 0-3.3V range of the input.
|
||||
* @param offset The value (in desired units) representing the
|
||||
|
||||
@@ -37,10 +37,8 @@ class Encoder : public CounterBase,
|
||||
*
|
||||
* The counter will start counting immediately.
|
||||
*
|
||||
* @param aChannel The a channel DIO channel. 0-9 are on-board, 10-25
|
||||
* are on the MXP port
|
||||
* @param bChannel The b channel DIO channel. 0-9 are on-board, 10-25
|
||||
* are on the MXP port
|
||||
* @param aChannel The 'a' SmartIO channel.
|
||||
* @param bChannel The 'b' SmartIO channel.
|
||||
* @param reverseDirection represents the orientation of the encoder and
|
||||
* inverts the output values if necessary so forward
|
||||
* represents positive values.
|
||||
|
||||
@@ -25,8 +25,8 @@ class Robot : public wpi::TimedRobot {
|
||||
}
|
||||
|
||||
private:
|
||||
// Creates an ADXL345 accelerometer object on the MXP I2C port
|
||||
// with a measurement range from -8 to 8 G's
|
||||
// Creates an ADXL345 accelerometer object with a measurement range from -8 to
|
||||
// 8 G's
|
||||
wpi::ADXL345_I2C m_accelerometer{wpi::I2C::Port::PORT_0,
|
||||
wpi::ADXL345_I2C::Range::kRange_8G};
|
||||
};
|
||||
|
||||
@@ -30,8 +30,7 @@ public class {{ name }} extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the {{ DisplayName }} is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the {{ DisplayName }} is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public {{ name }}(final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class Koors40 extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the Koors40 is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the Koors40 is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public Koors40(final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class PWMSparkFlex extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the SPARK Flex is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the SPARK Flex is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public PWMSparkFlex(final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class PWMSparkMax extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the SPARK MAX is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the SPARK MAX is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public PWMSparkMax(final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class PWMTalonFX extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the Talon FX is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the Talon FX is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public PWMTalonFX(final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class PWMTalonSRX extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the Talon SRX is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the Talon SRX is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public PWMTalonSRX(final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class PWMVenom extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the Venom is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the Venom is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public PWMVenom(final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class PWMVictorSPX extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the Victor SPX is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the Victor SPX is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public PWMVictorSPX(final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class Spark extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the SPARK is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the SPARK is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public Spark(final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class SparkMini extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the SPARKMini is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the SPARKMini is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public SparkMini(final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class Talon extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the Talon is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the Talon is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public Talon(final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class VictorSP extends PWMMotorController {
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The PWM channel that the Victor SP is attached to. 0-9 are on-board, 10-19
|
||||
* are on the MXP port
|
||||
* @param channel The SmartIO channel that the Victor SP is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public VictorSP(final int channel) {
|
||||
|
||||
@@ -15,13 +15,6 @@ import org.wpilib.util.sendable.SendableRegistry;
|
||||
* Analog channel class.
|
||||
*
|
||||
* <p>Each analog channel is read from hardware as a 12-bit number representing 0V to 3.3V.
|
||||
*
|
||||
* <p>Connected to each analog channel is an averaging and oversampling engine. This engine
|
||||
* accumulates the specified ( by setAverageBits() and setOversampleBits() ) number of samples
|
||||
* before returning a new value. This is not a sliding window average. The only difference between
|
||||
* the oversampled samples and the averaged samples is that the oversampled samples are simply
|
||||
* accumulated effectively increasing the resolution, while the averaged samples are divided by the
|
||||
* number of samples to retain the resolution, but get more stable values.
|
||||
*/
|
||||
public class AnalogInput implements Sendable, AutoCloseable {
|
||||
int m_port; // explicit no modifier, private and package accessible.
|
||||
@@ -30,7 +23,7 @@ public class AnalogInput implements Sendable, AutoCloseable {
|
||||
/**
|
||||
* Construct an analog channel.
|
||||
*
|
||||
* @param channel The channel number to represent. 0-3 are on-board 4-7 are on the MXP port.
|
||||
* @param channel The SmartIO channel for the analog input.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public AnalogInput(final int channel) {
|
||||
|
||||
@@ -25,7 +25,7 @@ public class DigitalInput implements AutoCloseable, Sendable {
|
||||
/**
|
||||
* Create an instance of a Digital Input class. Creates a digital input given a channel.
|
||||
*
|
||||
* @param channel the DIO channel for the digital input 0-9 are on-board, 10-25 are on the MXP
|
||||
* @param channel the SmartIO channel for the digital input
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public DigitalInput(int channel) {
|
||||
|
||||
@@ -26,8 +26,7 @@ public class DigitalOutput implements AutoCloseable, Sendable {
|
||||
/**
|
||||
* Create an instance of a digital output. Create an instance of a digital output given a channel.
|
||||
*
|
||||
* @param channel the DIO channel to use for the digital output. 0-9 are on-board, 10-25 are on
|
||||
* the MXP
|
||||
* @param channel the SmartIO channel to use for the digital output.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public DigitalOutput(int channel) {
|
||||
|
||||
@@ -42,7 +42,7 @@ public class PWM implements Sendable, AutoCloseable {
|
||||
*
|
||||
* <p>By default, adds itself to SendableRegistry.
|
||||
*
|
||||
* @param channel The PWM channel number. 0-9 are on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel number.
|
||||
*/
|
||||
public PWM(final int channel) {
|
||||
this(channel, true);
|
||||
@@ -51,7 +51,7 @@ public class PWM implements Sendable, AutoCloseable {
|
||||
/**
|
||||
* Allocate a PWM given a channel.
|
||||
*
|
||||
* @param channel The PWM channel number. 0-9 are on-board, 10-19 are on the MXP port
|
||||
* @param channel The SmartIO channel number.
|
||||
* @param registerSendable If true, adds this instance to SendableRegistry
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
|
||||
@@ -38,8 +38,7 @@ public abstract class PWMMotorController extends MotorSafety
|
||||
* Constructor.
|
||||
*
|
||||
* @param name Name to use for SendableRegistry
|
||||
* @param channel The PWM channel that the controller is attached to. 0-9 are on-board, 10-19 are
|
||||
* on the MXP port
|
||||
* @param channel The SmartIO channel that the controller is attached to.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
protected PWMMotorController(final String name, final int channel) {
|
||||
|
||||
@@ -30,8 +30,7 @@ public class AnalogPotentiometer implements Sendable, AutoCloseable {
|
||||
* point after scaling is 135 degrees. This will calculate the result from the fullRange times the
|
||||
* fraction of the supply voltage, plus the offset.
|
||||
*
|
||||
* @param channel The analog input channel this potentiometer is plugged into. 0-3 are on-board
|
||||
* and 4-7 are on the MXP port.
|
||||
* @param channel The SmartIO channel this potentiometer is plugged into.
|
||||
* @param fullRange The scaling to multiply the fraction by to get a meaningful unit.
|
||||
* @param offset The offset to add to the scaled value for controlling the zero value
|
||||
*/
|
||||
@@ -73,8 +72,7 @@ public class AnalogPotentiometer implements Sendable, AutoCloseable {
|
||||
* degree potentiometer, and you want the output to be degrees with the starting point as 0
|
||||
* degrees. The scale value is 270.0(degrees).
|
||||
*
|
||||
* @param channel The analog input channel this potentiometer is plugged into. 0-3 are on-board
|
||||
* and 4-7 are on the MXP port.
|
||||
* @param channel The analog input channel this potentiometer is plugged into.
|
||||
* @param scale The scaling to multiply the voltage by to get a meaningful unit.
|
||||
*/
|
||||
public AnalogPotentiometer(final int channel, double scale) {
|
||||
@@ -100,8 +98,7 @@ public class AnalogPotentiometer implements Sendable, AutoCloseable {
|
||||
*
|
||||
* <p>The potentiometer will return a value between 0 and 1.0.
|
||||
*
|
||||
* @param channel The analog input channel this potentiometer is plugged into. 0-3 are on-board
|
||||
* and 4-7 are on the MXP port.
|
||||
* @param channel The analog input channel this potentiometer is plugged into.
|
||||
*/
|
||||
public AnalogPotentiometer(final int channel) {
|
||||
this(channel, 1, 0);
|
||||
|
||||
@@ -64,8 +64,8 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
* @param channelA The 'a' channel DIO channel. 0-9 are on-board, 10-25 are on the MXP port
|
||||
* @param channelB The 'b' channel DIO channel. 0-9 are on-board, 10-25 are on the MXP port
|
||||
* @param channelA The 'a' SmartIO channel.
|
||||
* @param channelB The 'b' SmartIO channel.
|
||||
* @param reverseDirection represents the orientation of the encoder and inverts the output values
|
||||
* if necessary so forward represents positive values.
|
||||
*/
|
||||
@@ -78,8 +78,8 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
* @param channelA The a channel digital input channel.
|
||||
* @param channelB The b channel digital input channel.
|
||||
* @param channelA The 'a' SmartIO channel.
|
||||
* @param channelB The 'b' SmartIO channel.
|
||||
*/
|
||||
public Encoder(final int channelA, final int channelB) {
|
||||
this(channelA, channelB, false);
|
||||
@@ -90,8 +90,8 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
* @param channelA The a channel digital input channel.
|
||||
* @param channelB The b channel digital input channel.
|
||||
* @param channelA The 'a' SmartIO channel.
|
||||
* @param channelB The 'b' SmartIO channel.
|
||||
* @param reverseDirection represents the orientation of the encoder and inverts the output values
|
||||
* if necessary so forward represents positive values.
|
||||
* @param encodingType either k1X, k2X, or k4X to indicate 1X, 2X or 4X decoding. If 4X is
|
||||
|
||||
@@ -13,8 +13,7 @@ import org.wpilib.hardware.bus.I2C;
|
||||
* https://docs.wpilib.org/en/stable/docs/software/hardware-apis/sensors/accelerometers-software.html
|
||||
*/
|
||||
public class Robot extends TimedRobot {
|
||||
// Creates an ADXL345 accelerometer object on the MXP I2C port
|
||||
// with a measurement range from -8 to 8 G's
|
||||
// Creates an ADXL345 accelerometer object with a measurement range from -8 to 8 G's
|
||||
ADXL345_I2C m_accelerometer345I2C = new ADXL345_I2C(I2C.Port.PORT_0, ADXL345_I2C.Range.k8G);
|
||||
|
||||
/** Called once at the beginning of the robot program. */
|
||||
|
||||
Reference in New Issue
Block a user