我要在12864的屏幕上顯示dbcl,djcl這兩個數字,從0-65顯示都是正常的,一旦到了66就又從零開始了。不清楚是我的計算出問題了還是
數據分解顯示出問題了。請求各位大佬解惑。謝謝了。代碼如下。
void tablex(u32 tab1)//數據分解
{
// h[0]=tab1/100000000000;
h[0]=tab1/1000000000%10;//十億
h[1]=tab1/100000000%10;//億
h[2]=tab1/10000000%10;//千萬
h[3]=tab1/1000000%10;//百萬
h[4]=tab1/100000%10;//十萬
h[5]=tab1/10000%10;//萬
h[6]=tab1/1000%10;//千
h[7]=tab1/100%10;//百
h[8]=tab1/10%10;//十
h[9]=tab1%10;//個
}
/******************** 數字刷新函數 **************************/
void szsx(void)
{
u8 i;
u16 dbcl,djcl;
dbcl=(dbclmc*jxzj)/1000;
djcl=djclmc*jxzj/1000;
tablex(dbcl);
LCD_set_xy(3,2);
for(i=6; i<10; i++) LCD_Write_number(h[ i]);
tablex(djcl);
LCD_set_xy(3,6);
for(i=6; i<10; i++) LCD_Write_number(h[ i]);
}
|