ETrobocon2017 - 片山研究所モデルベース開発推進事業部
str
ev3-api
library
libcpp-ev3
include
Sensor.h
[詳解]
1
//
2
// Sensor.h
3
//
4
// Copyright (c) 2015-2016 Embedded Technology Software Design Robot Contest
5
//
6
7
#ifndef EV3CPPAPI_SENSOR_H_
8
#define EV3CPPAPI_SENSOR_H_
9
10
#include "
Port.h
"
11
12
#include "ev3api.h"
13
14
namespace
ev3api
{
18
class
Sensor
19
{
20
protected
:
26
inline
sensor_port_t
getPort
(
void
)
const
{
return
mPort; }
27
34
explicit
Sensor
(
ePortS
port, sensor_type_t type)
35
:mPort(static_cast<sensor_port_t>(port)), mType(type)
36
{
37
ev3_sensor_config(
getPort
(), type);
38
}
39
45
virtual
~Sensor
(
void
) { }
46
47
private
:
48
sensor_port_t mPort;
49
sensor_type_t mType;
50
};
// class Sensor
51
}
// namespace ev3api
52
53
#endif // ! EV3CPPAPI_SENSOR_H_
ev3api
Definition:
Clock.h:12
ev3api::Sensor::getPort
sensor_port_t getPort(void) const
Definition:
Sensor.h:26
Port.h
モータ/センサポート関連定義
ev3api::Sensor::Sensor
Sensor(ePortS port, sensor_type_t type)
Definition:
Sensor.h:34
ePortS
ePortS
Definition:
Port.h:18
ev3api::Sensor
Definition:
Sensor.h:18
ev3api::Sensor::~Sensor
virtual ~Sensor(void)
Definition:
Sensor.h:45
構築:
1.8.13