LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
buttonBase.hpp
Go to the documentation of this file.
1
/*
2
* This Source Code Form is subject to the terms of the Mozilla Public
3
* License, v. 2.0. If a copy of the MPL was not distributed with this
4
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
*/
6
#pragma once
7
8
#include "
okapi/api/device/button/abstractButton.hpp
"
9
10
namespace
okapi
{
11
class
ButtonBase
:
public
AbstractButton
{
12
public
:
17
explicit
ButtonBase
(
bool
iinverted =
false
);
18
22
bool
isPressed
()
override
;
23
27
bool
changed
()
override
;
28
33
bool
changedToPressed
()
override
;
34
39
bool
changedToReleased
()
override
;
40
41
protected
:
42
bool
inverted
{
false
};
43
bool
wasPressedLast_c
{
false
};
44
bool
wasPressedLast_ctp
{
false
};
45
bool
wasPressedLast_ctr
{
false
};
46
47
virtual
bool
currentlyPressed
() = 0;
48
49
private
:
50
bool
changedImpl(
bool
&prevState);
51
};
52
}
// namespace okapi
abstractButton.hpp
okapi::AbstractButton
Definition
abstractButton.hpp:11
okapi::ButtonBase
Definition
buttonBase.hpp:11
okapi::ButtonBase::changed
bool changed() override
Return whether the state of the button changed since the last time this method was called.
okapi::ButtonBase::wasPressedLast_ctp
bool wasPressedLast_ctp
Definition
buttonBase.hpp:44
okapi::ButtonBase::wasPressedLast_c
bool wasPressedLast_c
Definition
buttonBase.hpp:43
okapi::ButtonBase::ButtonBase
ButtonBase(bool iinverted=false)
okapi::ButtonBase::inverted
bool inverted
Definition
buttonBase.hpp:42
okapi::ButtonBase::currentlyPressed
virtual bool currentlyPressed()=0
okapi::ButtonBase::changedToReleased
bool changedToReleased() override
Return whether the state of the button to not pressed since the last time this method was called.
okapi::ButtonBase::isPressed
bool isPressed() override
Return whether the button is currently pressed.
okapi::ButtonBase::wasPressedLast_ctr
bool wasPressedLast_ctr
Definition
buttonBase.hpp:45
okapi::ButtonBase::changedToPressed
bool changedToPressed() override
Return whether the state of the button changed to pressed since the last time this method was called.
okapi
Definition
chassisController.hpp:16
include
okapi
api
device
button
buttonBase.hpp
Generated by
1.9.8