mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-05 03:21:42 +00:00
[xrp] Add getter for XRP LED (#7327)
This commit is contained in:
committed by
GitHub
parent
44c0bbc4a9
commit
23e71e10e4
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,3 +18,7 @@ bool XRPOnBoardIO::GetUserButtonPressed() {
|
||||
void XRPOnBoardIO::SetLed(bool value) {
|
||||
m_led.Set(value);
|
||||
}
|
||||
|
||||
bool XRPOnBoardIO::GetLed() const {
|
||||
return m_led.Get();
|
||||
}
|
||||
|
||||
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user