C语言中unsigned char中的数据怎么传送,怎么获取传送数据
颜色传感器中的数据
unsigned char color_cube(void)
{
u8 r,g,b;
r = color_get_r();
g = color_get_g();
b = color_get_b();
if (r>g && r>b)
return 1;
if (b>r && b>g)
return 3;
else
return 2;
}
这样写对吗
/* 颜色识别,设置目标点路径选择 */
status.location = '0';
status.destination = color_cube();
小车能运行但不能进项颜色变化选择路径,在我在线仿真的时候unsigned char color_cube(void)数据没有变化这是怎么回事
仿真看看你读出的r,g,b的值