WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::romi::OnBoardIO Class Reference

This class represents the onboard IO of the Romi reference robot. More...

#include <wpi/romi/OnBoardIO.hpp>

Public Types

enum  ChannelMode { INPUT , OUTPUT }
 Mode for Romi onboard IO. More...

Public Member Functions

 OnBoardIO (OnBoardIO::ChannelMode dio1, OnBoardIO::ChannelMode dio2)
bool GetButtonAPressed ()
 Gets if the A button is pressed.
bool GetButtonBPressed ()
 Gets if the B button is pressed.
bool GetButtonCPressed ()
 Gets if the C button is pressed.
void SetGreenLed (bool value)
 Sets the green LED.
void SetRedLed (bool value)
 Sets the red LED.
void SetYellowLed (bool value)
 Sets the yellow LED.

Public Attributes

wpi::units::second_t m_nextMessageTime = 0_s

Static Public Attributes

static constexpr auto kMessageInterval = 1_s

Detailed Description

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)

Member Enumeration Documentation

◆ ChannelMode

Mode for Romi onboard IO.

Enumerator
INPUT 

Input.

OUTPUT 

Output.

Constructor & Destructor Documentation

◆ OnBoardIO()

wpi::romi::OnBoardIO::OnBoardIO ( OnBoardIO::ChannelMode dio1,
OnBoardIO::ChannelMode dio2 )

Member Function Documentation

◆ GetButtonAPressed()

bool wpi::romi::OnBoardIO::GetButtonAPressed ( )

Gets if the A button is pressed.

◆ GetButtonBPressed()

bool wpi::romi::OnBoardIO::GetButtonBPressed ( )

Gets if the B button is pressed.

◆ GetButtonCPressed()

bool wpi::romi::OnBoardIO::GetButtonCPressed ( )

Gets if the C button is pressed.

◆ SetGreenLed()

void wpi::romi::OnBoardIO::SetGreenLed ( bool value)

Sets the green LED.

◆ SetRedLed()

void wpi::romi::OnBoardIO::SetRedLed ( bool value)

Sets the red LED.

◆ SetYellowLed()

void wpi::romi::OnBoardIO::SetYellowLed ( bool value)

Sets the yellow LED.

Member Data Documentation

◆ kMessageInterval

auto wpi::romi::OnBoardIO::kMessageInterval = 1_s
staticconstexpr

◆ m_nextMessageTime

wpi::units::second_t wpi::romi::OnBoardIO::m_nextMessageTime = 0_s

The documentation for this class was generated from the following file: