19 #if defined(BUILD_MODULE) 20 #include "module_cfg.h" 22 #include "kernel_cfg.h" 33 static int g_bluetooth_command = 0;
34 static FILE *g_bluetooth = NULL;
40 g_bluetooth = ev3_serial_open_file( EV3_SERIAL_BT );
41 assert( g_bluetooth != NULL );
47 msg_f(
"Check Colors", 1);
48 msg_f(
" create from github.com/korosuke613/etrobocon2017", 2);
55 std::string color_name[8] = {
"NONE",
"BLACK",
"BLUE",
"GREEN",
"YELLOW",
"RED",
"WHITE",
"BROWN"};
60 sprintf ( msg,
"LightValue: %d", colorSensor.
getBrightness());
63 sprintf ( msg,
"ColorNumber: %s", color_name[color_num].c_str());
65 sprintf ( msg,
" R:%3d G:%3d B:%3d", rgb.r, rgb.g, rgb.b);
68 sprintf ( msg,
"DistanceEye: %d", sonarSensor.
getDistance());
75 sprintf ( msg,
"DistanceTime: %d", time_count);
86 fclose( g_bluetooth );
102 uint8_t c = fgetc( g_bluetooth );
106 g_bluetooth_command = 1;
111 fputc( c, g_bluetooth );
void main_task(intptr_t unused)
void bt_task(intptr_t unused)
bool isPressed(void) const
void msg_f(const char *str, int32_t line)
int8_t getBrightness(void) const
colorid_t getColorNumber(void) const
void getRawColor(rgb_raw_t &rgb) const
int16_t getDistance(void) const