}
{ }
SHUJU=1;
for(i=0;i<110;i++);//delay 1ms SHUJU=0;
for(i=0;i<110;i++);//delay 1ms z--;
unsigned char gFlag=0; void main(void) {
/* unsigned int i,j;
LCDInit();
LCDDispChar(0,1,'0'); while(1) { }*/
unsigned long res;
unsigned int weight=0,temp=0; unsigned int weightL=0,Error=0; double sumofprice=0; unsigned char value=16,i; LCDInit(); while(!BUSY); Music(L_dian);//点 while(1)
LCDDispChar(0,1,'0'); Music(1);LCDDispChar(1,1,'1'); for(i=0;i<10;i++) { }
LCDDispChar(0,1,'o');
Music(i); while(!BUSY);
{
res = Weight(); if(count >= 50) {
LCDDispString(0,1,\
LCDDispNum(2,1,(int)(Price/10)); LCDDispNum(3,1,(int)(Price)); LCDDispChar(4,1,'.') ;
LCDDispNum(5,1,(int)(Price*10)); LCDDispString(6,1,\LCDDispString(7,1,\LCDDispString(8,1,\LCDDispString(10,1,\count = 0;
if(res >= ZeroWeight)
res = res-ZeroWeight; res = 0; else
res = res/403.60706722; if(res>5000) { } else { }
weight=res;
LCDDispString(11,1,\ \LCDDispNum(11,1,res/1000); LCDDispNum(12,1,res/100); LCDDispNum(13,1,res/10); LCDDispNum(14,1,res); LCDDispString(15,1,\
BEEP =
1;
BEEP =
0;
LCDDispString(0,2,\
sumofprice = (double)res*Price/1000.0; LCDDispString(5,2,\ \
LCDDispNum(5,2,(int)(sumofprice/100)); LCDDispNum(6,2,(int)(sumofprice/10)); LCDDispNum(7,2,(int)(sumofprice)); LCDDispChar(8,2,'.') ;
LCDDispNum(9,2,(int)(sumofprice*10)); temp= (int)(sumofprice*100) ; if(temp>9)
temp=9;
LCDDispNum(10,2,temp); if((gFlag==0)||(weight==0)) { }
if(weightL>weight) {
while(!BUSY); Music(L_zhongliang); while(!BUSY);
Music(weight/1000+1);//?xxxg while(!BUSY); Music(L_dian);//点 while(!BUSY);
Music(weight/100+1);//x?xxg while(!BUSY);
Music(weight/10+1);//xx?xg while(!BUSY); Error = weightL-weight; Error = weight-weightL; else if(Error>3)
weightL = weight; gFlag=1;
Music(weight+1);//xxx?g while(!BUSY); Music(L_kg);//千克 while(!BUSY); Music(L_zongjia); { }
else if(sumofprice>100) //>100的除了 100 200...900 {
while(!BUSY);
Music((int)(sumofprice/100)+1); while(!BUSY);
和100.XX 200.XX的其余情况
if((int)(sumofprice*10)==0 && (int)(sumofprice*100)==0) { } else{ }
while(!BUSY);
Music((int)(sumofprice/100)+1); while(!BUSY); Music(L_bai); while(!BUSY); Music(L_dian); while(!BUSY);
Music((int)(sumofprice*10)+1); while(!BUSY);
Music((int)(sumofprice*100)+1);
while(!BUSY);
Music((int)(sumofprice/100)+1); while(!BUSY); Music(L_bai);
if((int)sumofprice0==0&&sumofprice>1)