etrobocon2018 feat.KatLab  770af34cce41ae9c30c41303275e1add2daae0c3 (with uncommitted changes)
 全て クラス 名前空間 ファイル 関数 変数 列挙型 列挙値 フレンド マクロ定義 ページ
公開メンバ関数 | 全メンバ一覧
EtRobocon2018 クラス

#include <EtRobocon2018.h>

EtRobocon2018 連携図
Collaboration graph

公開メンバ関数

 EtRobocon2018 ()
 
void start (int)
 
void waitStarter (int)
 
void loop ()
 

詳解

main的なクラス

EtRobocon2018.h22 行目に定義があります。

構築子と解体子

EtRobocon2018::EtRobocon2018 ( )

コンストラクタ。各センサー等の初期化を行う

TODO Courseクラスに移す

EtRobocon2018.cpp29 行目に定義があります。

30 {
32  controller.speakerSetVolume(100);
33 }
void speakerSetVolume(uint8_t volume)
Definition: Controller.cpp:4

呼び出し関係図:

関数詳解

void EtRobocon2018::loop ( )

実際にマシンを動かすときの処理

EtRobocon2018.cpp56 行目に定義があります。

57 {
58  // Rコースを走らせるときは1, Lコースを走らせるときは0
59  auto brightness = target_brightness;
60 #ifdef IS_RIGHT_COURSE
61  RightCourse rightCourse{ controller, firstCode };
62  rightCourse.run(brightness, light_black, light_white, light_gray);
63 #else
64  LeftCourse leftCourse{ controller };
65  leftCourse.run(brightness, light_black, light_white, light_gray);
66 #endif
67 }

被呼び出し関係図:

void EtRobocon2018::start ( int  bluetooth_command)

タッチセンサが押されたときに行われる処理

EtRobocon2018.cpp35 行目に定義があります。

36 {
37  UserInterface ui{ controller };
38 #ifdef IS_RIGHT_COURSE
39  ui.inputFirstCode();
40  firstCode = ui.getFirstCode();
41 #else
42 #endif
43  ui.setBrightnessWithColor(light_white, "white");
44  ui.setBrightnessWithColor(light_black, "black");
45  ui.setBrightnessWithColor(light_gray, "gray");
46  target_brightness = (light_black + light_white) / 2;
47  controller.printDisplay(7, "Brightness W:%d, B:%d, T:%d", light_white, light_black,
48  target_brightness);
49  controller.ledSetColorOrange();
50  waitStarter(bluetooth_command);
51  controller.ledSetColorGreen();
52 
53  loop();
54 }
走行体が走り出す前にユーザが入力するインターフェースを提供するクラス
Definition: UserInterface.h:25
void ledSetColorOrange()
Definition: Controller.cpp:14
void waitStarter(int)
void ledSetColorGreen()
Definition: Controller.cpp:19
void printDisplay(int8_t row, const char *format,...)
Definition: Controller.cpp:79

呼び出し関係図:

被呼び出し関係図:

void EtRobocon2018::waitStarter ( int  bluetooth_command)

スイッチを入れたときに行われる処理

EtRobocon2018.cpp69 行目に定義があります。

70 {
71  /* スタート待機 */
72  while(1) {
73  if(bluetooth_command == 1) {
74  break; /* リモートスタート */
75  }
76 
77  if(controller.touchSensor.isPressed() == 1) {
78  controller.tslpTsk(500);
79  break; /* タッチセンサが押された */
80  }
81 
82  controller.tslpTsk(10); /* 10msecウェイト */
83  }
84 }
void tslpTsk(int16_t time)
Definition: Controller.cpp:74
TouchSensor touchSensor
Definition: Controller.h:42
bool isPressed(void) const
Definition: TouchSensor.cpp:20

呼び出し関係図:

被呼び出し関係図:


このクラス詳解は次のファイルから抽出されました: