Package edu.wpi.first.wpilibj.romi
Class OnBoardIO
java.lang.Object
edu.wpi.first.wpilibj.romi.OnBoardIO
This class represents the onboard IO of the Romi reference robot. This includes the pushbuttons
and LEDs.
DIO 0 - Button A (input only) DIO 1 - Button B (input) or Green LED (output) DIO 2 - Button C (input) or Red LED (output) DIO 3 - Yellow LED (output only)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Mode for Romi onboard IO channel. -
Constructor Summary
ConstructorDescriptionOnBoardIO
(OnBoardIO.ChannelMode dio1, OnBoardIO.ChannelMode dio2) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets if the A button is pressed.boolean
Gets if the B button is pressed.boolean
Gets if the C button is pressed.void
setGreenLed
(boolean value) Sets the green LED.void
setRedLed
(boolean value) Sets the red LED.void
setYellowLed
(boolean value) Sets the yellow LED.
-
Constructor Details
-
OnBoardIO
Constructor.- Parameters:
dio1
- Mode for DIO 1 (input = Button B, output = green LED)dio2
- Mode for DIO 2 (input = Button C, output = red LED)
-
-
Method Details
-
getButtonAPressed
Gets if the A button is pressed.- Returns:
- Whether or not Button A is pressed
-
getButtonBPressed
Gets if the B button is pressed.- Returns:
- Whether or not Button B is pressed
-
getButtonCPressed
Gets if the C button is pressed.- Returns:
- Whether or not Button C is pressed
-
setGreenLed
Sets the green LED.- Parameters:
value
- Set whether or not to turn the Green LED on
-
setRedLed
Sets the red LED.- Parameters:
value
- Set whether or not to turn the Red LED on
-
setYellowLed
Sets the yellow LED.- Parameters:
value
- Set whether or not to turn the Yellow LED on
-