}
}
SCK = 1; temp = temp<<1; SCK = 0; if(DOUT)
temp++;
SCK = 1;
temp = temp^0x800000; temp = 0x800000-temp; SCK = 0; count++; return temp;
// delayms(100); void delay(unsigned int i) { }
unsigned char key_scan(void) {
unsigned char get_port = 0; unsigned char temp = 16; Key_port = 0xfe;
get_port = Key_port; unsigned int x,y; for(x= 0;x
get_port = get_port & 0xf0; {
delay(10);
get_port = Key_port; get_port = get_port & 0xf0; if(get_port != 0xf0) {
if(get_port != 0xf0)
}
} //if
get_port = Key_port; switch(get_port) { } { }
get_port = Key_port; get_port = get_port & 0xf0; //while
case 0xee:temp=0;break; case 0xde:temp=1;break; case 0xbe:temp=2;break; case 0x7e:temp=3;break; //switch
while(get_port != 0xf0)
//if
Key_port = 0xfd;
get_port = Key_port;
get_port = get_port & 0xf0; {
delay(10);
get_port = Key_port; get_port = get_port & 0xf0; if(get_port != 0xf0) {
get_port = Key_port; switch(get_port) { }
case 0xed:temp=10;break; case 0xdd:temp=4;break; case 0x7d:temp=6;break; //switch
if(get_port != 0xf0)
case 0xbd:temp=5;break;
}
} //if
while(get_port != 0xf0) { }
get_port = Key_port; get_port = get_port & 0xf0; //while
//if
Key_port = 0xfb;
get_port = Key_port; if(get_port != 0xf0) { }
delay(10);
get_port = get_port & 0xf0;
get_port = Key_port; get_port = get_port & 0xf0; if(get_port != 0xf0) { } //if
get_port = Key_port; switch(get_port) { } { }
get_port = Key_port; get_port = get_port & 0xf0; //while
case 0xeb:temp=11;break; case 0xdb:temp=7;break; case 0xbb:temp=8;break; case 0x7b:temp=9;break; //switch
while(get_port != 0xf0)
//if
Key_port = 0xf7;
get_port = Key_port;
}
get_port = get_port & 0xf0;
{ }
delay(10);
get_port = Key_port; get_port = get_port & 0xf0; if(get_port != 0xf0) { }
get_port = Key_port; switch(get_port) { } { }
get_port = Key_port; get_port = get_port & 0xf0; //while
case 0xe7:temp=12;break; case 0xd7:temp=13;break; case 0xb7:temp=14;break; case 0x77:temp=15;break; //switch
if(get_port != 0xf0)
while(get_port != 0xf0)
//if
//if
return temp;
void Music(z) {
unsigned char i; SHUJU=0; RST=1;
for(i=0;i<220;i++);//delay 2ms RST=0;
for(i=0;i<220;i++);//delay 2ms while(z>0)