40 g_bluetooth = ev3_serial_open_file(EV3_SERIAL_BT);
41 assert(g_bluetooth != NULL);
46 msg_f(
"Check Colors", 1);
47 msg_f(
" create from github.com/korosuke613/etrobocon2017", 2);
54 std::string color_name[8]
55 = {
"NONE",
"BLACK",
"BLUE",
"GREEN",
"YELLOW",
"RED",
"WHITE",
"BROWN" };
58 color_num = (int)colorSensor.getColorNumber();
59 colorSensor.getRawColor(rgb);
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());
71 if(sonarSensor.getDistance() < 10) {
75 sprintf(msg,
"DistanceTime: %d", time_count);
78 if(touchSensor.isPressed() == 1) {
void msg_f(const char *str, int32_t line)