/*开关机测试程序 单片机AT89S52,晶振11.0592M 制作者:王兴 2019.7.22*/
#include<reg52.h>
#include <intrins.h>
#define uchar unsigned char
#define uint unsigned int
sbit sr1=P2^7;
sbit scl1=P2^6;
sbit sj=P2^5;
sbit kz=P2^2;//控制输出
sbit wm1=P0^0;
sbit wm2=P0^1;
sbit wm3=P0^2;
sbit wm4=P0^3;
sbit wm5=P0^4;
sbit wm6=P0^5;
sbit k1=P2^0;
sbit k2=P2^1;
sbit scl=P1^1; //时钟线
sbit sda=P1^0; //数据线
sbit led1=P2^3;
sbit led2=P2^4;
uchar temp;
uchar cs1=95;//次数
uchar cs2=99;
uchar cs3=9;
bit tz;
bit bz;
bit write=0;
uchar code duan[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x7f,0xff};//0 1 2 3 4 5 6 7 8 9 . 灭
void delay1(uchar cc)
{
uchar j;
for(;cc<40;cc++)
for(j=0;j<20;j++);
}
void xsj(uchar dat)
{
uchar i;
for(i=0;i<8;i++)
{
sj=dat&0x80;
|