标签:ble sig har err code inter c51 clu --
#include<reg52.h>
#include<intrins.h>
#define uint unsigned int
#define uchar unsigned char
sbit D=P2^6;
sbit W=P2^7;
sbit D0=P1^0;
uchar num;
uint x,y,z;
uchar code table[]={
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71};
void delay(uint);
void main()
{
EA=1;
EX0=1;
while(1)
{
D=1;
P0=table[1];
D=0;
P0=0xff;
W=1;
P0=0xfe;
W=0;
delay(500);
D=1;
P0=table[2];
D=0;
P0=0xff;
W=1;
P0=0xfd;
W=0;
delay(500);
D=1;
P0=table[3];
D=0;
P0=0xff;
W=1;
P0=0xfb;
W=0;
delay(500);
D=1;
P0=table[4];
D=0;
P0=0xff;
W=1;
P0=0xf7;
W=0;
delay(500);
D=1;
P0=table[5];
D=0;
P0=0xff;
W=1;
P0=0xef;
W=0;
delay(500);
D=1;
P0=table[6];
D=0;
P0=0xff;
W=1;
P0=0xdf;
W=0;
delay(500);
D=1;
P0=table[1];
D=0;
P0=0xff;
W=1;
P0=0xfe;
W=0;
delay(500);
}
}
void exter () interrupt 0
{
D0=0;
}
void delay(uint z)
{
for(x=z;x>0;x--)
for(y=100;y>0;y--);
}
标签:ble sig har err code inter c51 clu --
原文地址:https://www.cnblogs.com/guhongjiyuan1/p/9716331.html