uint8_t Wheel_getPosition(void)
{
uint8_t position = 0;
Wheel_getValue();
//determine which position the wheel is in
if (positionData > 0x0806)
position = 7 - (positionData - 0x0806) / 260; //scale the data for 8 different positions
else
position = positionData / 260;
{
uint8_t position = 0;
Wheel_getValue();
//determine which position the wheel is in
if (positionData > 0x0806)
position = 7 - (positionData - 0x0806) / 260; //scale the data for 8 different positions
else
position = positionData / 260;
return position;
}
}
下面这句不懂:
if (positionData > 0x0806)
position = 7 - (positionData - 0x0806) / 260; //scale the data for 8 different positions
position = 7 - (positionData - 0x0806) / 260; //scale the data for 8 different positions
为什吗是0X0806