独立按键#i nclude〈r e g5 2、h〉#d ef i ne uc h ar un si g ne d ch a r#def i ne uint unsig n ed in tsb it P 2 7=P2^7;s bi t K5=P 1^4;sb it f m q=P3^6;u ch ar num;u nsigned ch a r co de s8[1 6]={0x c0,0xf9,0xa 4,0 xb 0,0 x 9 9,0x92,0 x 8 2,0 x f8,0 x 80,0 x 90,0x88,0x83,0 x c 6,0x a1,0x 86,0 x8e};v o id d e l a y 1ms(ui nt i){uc h a r j; wh il e(i--) {f or(j=0;j〈115;j++) //1m s基准延时程序 {;}}}void b ee p() //产生 1 K HZ 频率声音得函数{ fmq=0;delay 5 00 u s();ﻩfmq=1;ﻩd e l a y50 0 us();}vo id d el ay5 0 0 us(){un s i gn ed ch ar j; for(j=0;j〈57;j++)ﻩ //500us基准延时程序 {; } }void ma i n(){ u cha r t; P27=0; whi l e(1){ if(K5==0){ﻩdelay 1m s(1 5);if(K5==0){ﻩfor(t=0;t〈100;t++)ﻩ{ beep();}ﻩ nu m=num+1; i f(num==16){ nu m=0;ﻩ } w hile(!K5);//等待按键释放}} P0=s 8[n um]; }}#in clude