1、/* writer:shopping.w */#include #define uint unsigned int#define uchar unsigned charsbit LED1 = P10;sbit LED2 = P13;sbit K1 = P17;uchar Operation_NO = 0;uchar code DSY_CODE=0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f;void Delay(uint x)uchar i;while(x-)for(i=0;i=0sbit LED2 = P13;sbit K1 = P17;u
2、char NumX = 0xff;void Delay(uint x)uchar i;while(x-)for(i=0;i120;i+);void main()LED1=LED2=1;SCON = 0x50;TMOD = 0x20;PCON = 0x00;TH1 = 0xfd;TL1 = 0xfd;TI = 0;RI = 0;TR1 = 1;IE = 0x90;while(1)Delay(100);if(K1=0);while(K1=0);NumX = (NumX+1)%11;SBUF = NumX;while(TI = 0);TI = 0;void Serial_INT() interrupt 4if(RI)RI = 0;switch(SBUF)case X: LED1=1;LED2=1;break;case A: LED1=0;LED2=1;break;case B: LED2=0;LED1=1;break;case C: LED1=0;LED2=0;