EV3RT CXX API Reference [English]
An RTOS-based development platform for LEGO Mindstorms EV3.
ev3cxx_touch_sensor.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_sensor.h"
13 #include "ev3cxx_button.h"
14 
15 namespace ev3cxx {
16 
22 {
23 public:
29  TouchSensor(SensorPort port) : Sensor(port, TOUCH_SENSOR) {}
30 
36  int isPressed() {
37  return ev3_touch_sensor_is_pressed(m_port);
38  }
39 
40 }; // class TouchSensor
41 
42 
43 } // namespace ev3cxx
44 
EV3RT CPP API for general button.
TouchSensor(SensorPort port)
Constructor of class TouchSensor.
int isPressed()
Get state of touch sensor.
Definition: ev3cxx.h:35
Class Sensor. API for working with sensor.
Definition: ev3cxx_sensor.h:30
Class TouchSensor. API for working with touch sensor.
Class Button. API for working with general button buttons.
Definition: ev3cxx_button.h:19
EV3RT CPP API for sensor.
SensorPort
Enum with index of sensor port.
Definition: ev3cxx_sensor.h:19