EV3RT CXX API Reference [English]
An RTOS-based development platform for LEGO Mindstorms EV3.
ev3cxx_brick_button.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include <stdio.h>
10 
11 #include "ev3api.h"
12 #include "ev3cxx_button.h"
13 
14 namespace ev3cxx {
15 
20 enum class BrickButtons {
21  LEFT = LEFT_BUTTON,
22  RIGHT = RIGHT_BUTTON,
23  UP = UP_BUTTON,
24  DOWN = DOWN_BUTTON,
25  ENTER = ENTER_BUTTON,
26  BACK = BACK_BUTTON
27 };
28 
34 {
35 public:
42  : m_button(button)
43  {}
44 
50  int isPressed() {
51  return ev3_button_is_pressed(static_cast<button_t>(m_button));
52  }
53 
54 private:
55  const BrickButtons m_button;
56 
57 }; // class BrickButton
58 
59 } // namespace ev3cxx
EV3RT CPP API for general button.
BrickButton(BrickButtons button)
Constructor of class BrickButton.
Definition: ev3cxx.h:35
Class BrickButton. API for working with brick buttons.
Enter brick button.
Up brick button.
Back brick button.
Right brick button.
Left brick button.
int isPressed()
Get state of brick button.
Class Button. API for working with general button buttons.
Definition: ev3cxx_button.h:19
BrickButtons
Enum with index of sensor port.
Down brick button.