EV3RT CXX API Reference [English]
An RTOS-based development platform for LEGO Mindstorms EV3.
ev3cxx_button.h
Go to the documentation of this file.
1
7
#pragma once
8
9
#include "ev3api.h"
10
11
namespace
ev3cxx
{
12
13
namespace
detail {
14
19
class
Button
20
{
21
public
:
27
virtual
int
isPressed
() = 0;
28
33
void
waitForPress
() {
34
while
(!
isPressed
())
35
tslp_tsk(1);
36
}
37
42
void
waitForRelease
() {
43
while
(
isPressed
())
44
tslp_tsk(1);
45
}
46
51
void
waitForClick
() {
52
waitForPress
();
53
waitForRelease
();
54
}
55
56
57
};
// class Button
58
59
}
// namespace detail
60
61
}
// namespace ev3cxx
ev3cxx
Definition:
ev3cxx.h:35
ev3cxx::detail::Button::waitForRelease
void waitForRelease()
Blocks until button is release.
Definition:
ev3cxx_button.h:42
ev3cxx::detail::Button::waitForClick
void waitForClick()
Blocks until button is clicked (press and release)
Definition:
ev3cxx_button.h:51
ev3cxx::detail::Button::isPressed
virtual int isPressed()=0
Get state of touch sensor.
ev3cxx::detail::Button
Class Button. API for working with general button buttons.
Definition:
ev3cxx_button.h:19
ev3cxx::detail::Button::waitForPress
void waitForPress()
Blocks until button is pressed.
Definition:
ev3cxx_button.h:33
library
lib-ev3cxx
include
ev3cxx_button.h
Generated on Mon May 15 2017 03:17:24 for EV3RT CXX API Reference [English] by
1.8.13