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

#include <controllerButton.hpp>

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

Public Member Functions

 ControllerButton (ControllerDigital ibtn, bool iinverted=false)
 A button on a Controller.
 
 ControllerButton (ControllerId icontroller, ControllerDigital ibtn, bool iinverted=false)
 A button on a Controller.
 
- 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

pros::controller_id_e_t id
 
pros::controller_digital_e_t btn
 
- 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 13 of file controllerButton.hpp.

Constructor & Destructor Documentation

◆ ControllerButton() [1/2]

okapi::ControllerButton::ControllerButton ( ControllerDigital  ibtn,
bool  iinverted = false 
)

A button on a Controller.

Parameters
ibtnThe button id.
iinvertedWhether the button is inverted (default pressed instead of default released).

◆ ControllerButton() [2/2]

okapi::ControllerButton::ControllerButton ( ControllerId  icontroller,
ControllerDigital  ibtn,
bool  iinverted = false 
)

A button on a Controller.

Parameters
icontrollerThe Controller the button is on.
ibtnThe button id.
iinvertedWhether the button is inverted (default pressed instead of default released).

Member Function Documentation

◆ currentlyPressed()

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

Implements okapi::ButtonBase.

Member Data Documentation

◆ btn

pros::controller_digital_e_t okapi::ControllerButton::btn
protected

Definition at line 34 of file controllerButton.hpp.

◆ id

pros::controller_id_e_t okapi::ControllerButton::id
protected

Definition at line 33 of file controllerButton.hpp.


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