diff --git a/xrpVendordep/src/main/java/edu/wpi/first/wpilibj/xrp/XRPOnBoardIO.java b/xrpVendordep/src/main/java/edu/wpi/first/wpilibj/xrp/XRPOnBoardIO.java index a37d417e0a..8a0f2f276d 100644 --- a/xrpVendordep/src/main/java/edu/wpi/first/wpilibj/xrp/XRPOnBoardIO.java +++ b/xrpVendordep/src/main/java/edu/wpi/first/wpilibj/xrp/XRPOnBoardIO.java @@ -38,4 +38,13 @@ public class XRPOnBoardIO { public void setLed(boolean value) { m_led.set(value); } + + /** + * Gets state of the onboard LED. + * + * @return True if LED is active, false otherwise. + */ + public boolean getLed() { + return m_led.get(); + } } diff --git a/xrpVendordep/src/main/native/cpp/xrp/XRPOnBoardIO.cpp b/xrpVendordep/src/main/native/cpp/xrp/XRPOnBoardIO.cpp index eb1ab6122b..c1d4b6a58c 100644 --- a/xrpVendordep/src/main/native/cpp/xrp/XRPOnBoardIO.cpp +++ b/xrpVendordep/src/main/native/cpp/xrp/XRPOnBoardIO.cpp @@ -18,3 +18,7 @@ bool XRPOnBoardIO::GetUserButtonPressed() { void XRPOnBoardIO::SetLed(bool value) { m_led.Set(value); } + +bool XRPOnBoardIO::GetLed() const { + return m_led.Get(); +} diff --git a/xrpVendordep/src/main/native/include/frc/xrp/XRPOnBoardIO.h b/xrpVendordep/src/main/native/include/frc/xrp/XRPOnBoardIO.h index dc3e0c2114..a4e92fad6e 100644 --- a/xrpVendordep/src/main/native/include/frc/xrp/XRPOnBoardIO.h +++ b/xrpVendordep/src/main/native/include/frc/xrp/XRPOnBoardIO.h @@ -35,6 +35,8 @@ class XRPOnBoardIO { /** * Gets if the USER button is pressed. + * + * @return True if the USER button is currently pressed. */ bool GetUserButtonPressed(); @@ -43,6 +45,13 @@ class XRPOnBoardIO { */ void SetLed(bool value); + /** + * Gets the state of the yellow LED. + * + * @return True if LED is active, false otherwise. + */ + bool GetLed() const; + private: frc::DigitalInput m_userButton{0}; frc::DigitalOutput m_led{1};