[xrp] Add getter for XRP LED (#7327)

This commit is contained in:
Kavin Muralikrishnan
2024-11-03 13:32:03 -05:00
committed by GitHub
parent 44c0bbc4a9
commit 23e71e10e4
3 changed files with 22 additions and 0 deletions

View File

@@ -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();
}
}

View File

@@ -18,3 +18,7 @@ bool XRPOnBoardIO::GetUserButtonPressed() {
void XRPOnBoardIO::SetLed(bool value) {
m_led.Set(value);
}
bool XRPOnBoardIO::GetLed() const {
return m_led.Get();
}

View File

@@ -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};