- #include<reg52.h>
- #include<absacc.h>
- #define H273U3 XBYTE[0x1fff]
- #define H273U6 XBYTE[0x7fff]
- unsigned char code led[10] = {0x81,0xcf,0x92,0x86,0xc1,
- 0xa4,0xa0,0x8f,0x80,0x84}; //共阳数码管(除DP外,以d为中心对调)0-9段码
-
- unsigned char code wei[2] = {0xfe,0xfd}; //第一位第二位 位码
- void main()
- {
- unsigned int t;
- H273U3 = 0xff; //关闭段选
- H273U6 = 0xff;
- while(1)
- {
- H273U3 = led[3];
- H273U6 = wei[0];
- for(t=0;t<1000;t++);
- H273U6 = 0xff;
-
- H273U3 = led[2];
- H273U6 = wei[1];
- for(t=0;t<1000;t++);
- H273U6 = 0xff;
- }
- }
复制代码
|