改来改去算法 第三位都只显示0
unsigned char code ASCII[15] = {'0','1','2','3','4','5','6','7','8','9','.','-','M'};
time=TH0*256+TL0;
S=(time*1.56672)/100;
disbuff[0]=S*10%1000/100;
disbuff[1]=S*10%1000%100/10;
disbuff[2]=S*10%1000%100%10;
OLED_ShowChar(60, 2, ASCII[disbuff[0]]);
OLED_ShowChar(72, 2, ASCII[disbuff[1]]);
OLED_ShowChar(84, 2, ASCII[disbuff[2]]);
OLED_ShowChar(108, 2, ASCII[12]); //显示M
OLED_ShowChar(120, 2, ASCII[12]); //显示M
想请问下是什么原因?算法有错误吗?
|