etrobocon2018 feat.KatLab  770af34cce41ae9c30c41303275e1add2daae0c3 (with uncommitted changes)
 全て クラス 名前空間 ファイル 関数 変数 列挙型 列挙値 フレンド マクロ定義 ページ
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_
モータ/センサポート関連定義
Sensor(ePortS port, sensor_type_t type)
Definition: Sensor.h:34
ePortS
Definition: Port.h:18
virtual ~Sensor(void)
Definition: Sensor.h:45
sensor_port_t getPort(void) const
Definition: Sensor.h:26