etrobocon2018 feat.KatLab  770af34cce41ae9c30c41303275e1add2daae0c3 (with uncommitted changes)
 全て クラス 名前空間 ファイル 関数 変数 列挙型 列挙値 フレンド マクロ定義 ページ
マクロ定義 | 関数
app.h ファイル
#include "target_test.h"
app.h の依存先関係図:
被依存関係図:

[ソースコード]

マクロ定義

#define MAIN_PRIORITY   5 /* メインタスクの優先度 */
 
#define HIGH_PRIORITY   9 /* 並行実行されるタスクの優先度 */
 
#define MID_PRIORITY   10
 
#define LOW_PRIORITY   11
 
#define TASK_PORTID   1 /* 文字入力するシリアルポートID */
 
#define STACK_SIZE   4096 /* タスクのスタックサイズ */
 

関数

void main_task (intptr_t exinf)
 
void bt_task (intptr_t exinf)
 

マクロ定義詳解

#define HIGH_PRIORITY   9 /* 並行実行されるタスクの優先度 */

app.h66 行目に定義があります。

#define LOW_PRIORITY   11

app.h68 行目に定義があります。

#define MAIN_PRIORITY   5 /* メインタスクの優先度 */

app.h63 行目に定義があります。

#define MID_PRIORITY   10

app.h67 行目に定義があります。

#define STACK_SIZE   4096 /* タスクのスタックサイズ */

app.h79 行目に定義があります。

#define TASK_PORTID   1 /* 文字入力するシリアルポートID */

app.h75 行目に定義があります。

関数詳解

void bt_task ( intptr_t  unused)

概要 : Bluetooth通信によるリモートスタート。 Tera Termなどのターミナルソフトから、 ASCIIコードで1を送信すると、リモートスタートする。 引数 : unused 返り値 : なし

color_check.cpp80 行目に定義があります。

81 {
82  while(1) {
83  uint8_t c = fgetc(g_bluetooth); /* 受信 */
84  switch(c) {
85  case '1':
86  g_bluetooth_command = 1;
87  break;
88  default:
89  break;
90  }
91  fputc(c, g_bluetooth); /* エコーバック */
92  }
93 }
void main_task ( intptr_t  exinf)

color_check.cpp33 行目に定義があります。

34 {
35  /* Open Bluetooth file */
36  g_bluetooth = ev3_serial_open_file(EV3_SERIAL_BT);
37  assert(g_bluetooth != NULL);
38 
39  /* Bluetooth通信タスクの起動 */
40  act_tsk(BT_TASK);
41 
42  Controller controller;
43  Distinguisher distinguisher{ controller };
44  const char* color_name[7] = { "NONE", "BLACK", "WHITE", "RED", "BLUE", "YELLOW", "GREEN" };
45  controller.printDisplay(1, "ET-Robocon2018");
46  controller.printDisplay(2, " create from github.com/korosuke613/etrobocon2018");
47  rgb_raw_t rgb;
48 
49  while(1) {
50  if(controller.buttonIsPressedBack()) {
51  break;
52  }
53  // controller.getRawColor(rgb.r, rgb.g, rgb.b);
54  // controller.printDisplay(4, "RGB: %d, %d, %d", rgb.r, rgb.g, rgb.b);
55  auto result = distinguisher.getColor();
56  controller.printDisplay(4, "HSV: %3d, %3d, %3d", static_cast<int16_t>(distinguisher.hsv.h),
57  static_cast<int16_t>(distinguisher.hsv.s),
58  static_cast<int16_t>(distinguisher.hsv.v));
59  // controller.printDisplay(5, "Color Distance: %lf", distinguisher.last_distance);
60  controller.printDisplay(6, "Color Number: %d", result);
61  controller.printDisplay(7, "Color Name: %s", color_name[static_cast<int>(result)]);
62  controller.printDisplay(8, "%d", controller.getBrightness());
63 
64  controller.tslpTsk(4);
65  }
66 
67  ter_tsk(BT_TASK);
68  fclose(g_bluetooth);
69 
70  ext_tsk();
71 }
void tslpTsk(int16_t time)
Definition: Controller.cpp:74
bool buttonIsPressedBack()
Definition: Controller.cpp:24
int16_t getBrightness()
Definition: Controller.cpp:59
走行体のカラーセンサを用いて、RGB情報より色を推定するクラス。
Definition: Distinguisher.h:55
void printDisplay(int8_t row, const char *format,...)
Definition: Controller.cpp:79