ETrobocon2017 - 片山研究所モデルベース開発推進事業部
str
ev3-api
library
libcpp-ev3
src
TouchSensor.cpp
[詳解]
1
//
2
// TouchSensor.cpp
3
//
4
// Copyright (c) 2015-2016 Embedded Technology Software Design Robot Contest
5
//
6
7
#include "
TouchSensor.h
"
8
using namespace
ev3api
;
9
10
11
//=============================================================================
12
// Constructor
13
TouchSensor::TouchSensor
(
ePortS
port)
14
:
15
Sensor
(port, TOUCH_SENSOR)
16
{}
17
18
//=============================================================================
19
// get Touch Sensor status
20
bool
TouchSensor::isPressed
(
void
)
const
21
{
22
return
static_cast<
bool
>
(ev3_touch_sensor_is_pressed(
getPort
()));
23
}
24
ev3api::TouchSensor::TouchSensor
TouchSensor(ePortS port)
Definition:
TouchSensor.cpp:13
ev3api
Definition:
Clock.h:12
ev3api::Sensor::getPort
sensor_port_t getPort(void) const
Definition:
Sensor.h:26
ePortS
ePortS
Definition:
Port.h:18
TouchSensor.h
ev3api::Sensor
Definition:
Sensor.h:18
ev3api::TouchSensor::isPressed
bool isPressed(void) const
Definition:
TouchSensor.cpp:20
構築:
1.8.13