以下是51单片机代码:
#include <reg51.h>
#define uchar unsigned char #define uint unsigned int
sbit K1=P3^2; sbit K2=P3^3; sbit LED=P1^0; sbit Buzzer=P1^1;
uchar i; uint count;
void delay(uint z) { uint x,y; for(x=z;x>0;x--) for(y=110;y>0;y--); }
void main() { while(1) { if(K1==0