Alex exoskeleton
ALEX SoftwareDocumentation
Main Page
Related Pages
Classes
Files
File List
File Members
Refactor
src
libs
inputDevice
Buttons.cpp
Go to the documentation of this file.
1
12
#include "
Buttons.h
"
13
#include "
DebugMacro.h
"
14
15
Buttons::Buttons
() {
16
DEBUG_OUT
(
"Button object created"
)
17
}
18
//set up buttons using GPIO manager
19
20
// get functions for each individual button and all buttons as an array
21
22
button_states
Buttons::getStates
() {
23
button_states
current_state = {this->
state
.
gButton
, this->
state
.
yButton
, this->
state
.
bButton
, this->
state
.
rButton
};
24
return
current_state;
25
};
26
void
Buttons::setStates
() {
27
//Read all 4 BUTTONs from i/o device
28
int
redbtn = 0;
29
int
bluebtn = 0;
30
int
greenbtn = 0;
31
int
yellowbtn = 0;
32
33
// Send buttons to variables
34
this->
state
.
yButton
= yellowbtn;
35
// this->gButton = greenbtn;
36
this->
state
.
bButton
= bluebtn;
37
this->
state
.
rButton
= redbtn;
38
this->
state
.
gButton
= greenbtn;
39
}
DebugMacro.h
Buttons::state
button_states state
Definition:
Buttons.h:35
button_states::gButton
int gButton
Definition:
Buttons.h:21
Buttons::setStates
void setStates()
Definition:
Buttons.cpp:26
Buttons::Buttons
Buttons()
Definition:
Buttons.cpp:15
button_states::rButton
int rButton
Definition:
Buttons.h:24
Buttons::getStates
button_states getStates()
Definition:
Buttons.cpp:22
button_states::bButton
int bButton
Definition:
Buttons.h:23
button_states
Describes the state of a set of buttons which include a Green, Yellow, Blue and Red. Used within the Buttons class. - Not currently used.
Definition:
Buttons.h:20
DEBUG_OUT
#define DEBUG_OUT(x)
Definition:
DebugMacro.h:11
Buttons.h
button_states::yButton
int yButton
Definition:
Buttons.h:22
Generated by
1.8.11