#include
#include
#define uint unsigned int
#define uchar unsigned char
#define LED7 XBYTE[0x9f00]
#define LED6 XBYTE[0x9f01]
#define LED5 XBYTE[0x9f02]
#define LED4 XBYTE[0x9f03]
#define LED3 XBYTE[0x9f04]
#define LED2 XBYTE[0x9f05]
#define LED1 XBYTE[0x9f06]
#define LED0 XBYTE[0x9f07]
sbit p27=P2^7;
sbit p26=P2^6;
sbit p25=P2^5;
sbit d0=P0^0;
sbit d1=P0^1;
sbit d2=P0^2;
sbit d3=P0^3;
sbit d4=P0^4;
sbit d5=P0^5;
sbit d6=P0^6;
sbit d7=P0^7;
uint t[]= //共阴数码显示表(89c52)
{
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x40
};
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
void init()
{
LED0=0;
LED1=0;
LED2=0;
LED3=0;
LED4=0;
LED5=0;
LED6=0;
LED7=0;
}
void keyscan()
{
p27=1;
p26=0;
p25=1;
阅读(652) | 评论(0) | 转发(0) |