LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
okapi::ADIButton Class Reference

#include <adiButton.hpp>

Inheritance diagram for okapi::ADIButton:
okapi::ButtonBase okapi::AbstractButton okapi::ControllerInput< bool >

Public Member Functions

 ADIButton (std::uint8_t iport, bool iinverted=false)
 A button in an ADI port.
 
 ADIButton (std::pair< std::uint8_t, std::uint8_t > iports, bool iinverted=false)
 A button in an ADI port.
 
- Public Member Functions inherited from okapi::ButtonBase
 ButtonBase (bool iinverted=false)
 
bool isPressed () override
 Return whether the button is currently pressed.
 
bool changed () override
 Return whether the state of the button changed since the last time this method was called.
 
bool changedToPressed () override
 Return whether the state of the button changed to pressed since the last time this method was called.
 
bool changedToReleased () override
 Return whether the state of the button to not pressed since the last time this method was called.
 
- Public Member Functions inherited from okapi::AbstractButton
virtual ~AbstractButton ()
 
virtual bool controllerGet () override
 Get the sensor value for use in a control loop.
 

Protected Member Functions

virtual bool currentlyPressed () override
 

Protected Attributes

std::uint8_t smartPort
 
std::uint8_t port
 
- Protected Attributes inherited from okapi::ButtonBase
bool inverted {false}
 
bool wasPressedLast_c {false}
 
bool wasPressedLast_ctp {false}
 
bool wasPressedLast_ctr {false}
 

Detailed Description

Definition at line 12 of file adiButton.hpp.

Constructor & Destructor Documentation

◆ ADIButton() [1/2]

okapi::ADIButton::ADIButton ( std::uint8_t  iport,
bool  iinverted = false 
)

A button in an ADI port.

auto btn = ADIButton('A', false);
auto invertedBtn = ADIButton('A', true);
Parameters
iportThe ADI port number ([1, 8], [a, h], [A, H]).
iinvertedWhether the button is inverted (true meaning default pressed and false meaning default not pressed).

◆ ADIButton() [2/2]

okapi::ADIButton::ADIButton ( std::pair< std::uint8_t, std::uint8_t >  iports,
bool  iinverted = false 
)

A button in an ADI port.

auto btn = ADIButton({1, 'A'}, false);
auto invertedBtn = ADIButton({1, 'A'}, true);
Parameters
iportsThe ports the button is plugged in to in the order {smart port, button port}. The smart port is the smart port number ([1, 21]). The button port is the ADI port number ([1, 8], [a, h], [A, H]).
iinvertedWhether the button is inverted (true meaning default pressed and false meaning default not pressed).

Member Function Documentation

◆ currentlyPressed()

virtual bool okapi::ADIButton::currentlyPressed ( )
overrideprotectedvirtual

Implements okapi::ButtonBase.

Member Data Documentation

◆ port

std::uint8_t okapi::ADIButton::port
protected

Definition at line 46 of file adiButton.hpp.

◆ smartPort

std::uint8_t okapi::ADIButton::smartPort
protected

Definition at line 45 of file adiButton.hpp.


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