case 1: //电位器值增加
{
unsigned char n = 0;
CS = 0;
U_D = 1;
_nop_();
//for(n=10;n>0;n--)
//{
INC = 0;
_nop_();
_nop_();
INC = 1;
//}
CS = 1;
VOLUME+=100;
if(VOLUME > 10000)VOLUME = 10000;
DISPLAY[0] = VOLUME/10000+0x30;
DISPLAY[1] = (VOLUME%10000/1000)+0x30;
DISPLAY[2] = (VOLUME%1000/100)+0x30;
DISPLAY[3] = (VOLUME%100/10)+0x30;
DISPLAY[4] = VOLUME%10+0x30;
Lcd_Set_xy(2,7);
Lcd_Wdat(DISPLAY[0]);
Lcd_Wdat(DISPLAY[1]);
Lcd_Wdat(DISPLAY[2]);
Lcd_Wdat(DISPLAY[3]);
Lcd_Wdat(DISPLAY[4]);
}
break;
有这个显示,按一次加100;加到200,就乱码了,求解
|