- 14
- 0
- 约1.93千字
- 约 4页
- 2020-04-05 发布于河北
- 举报
AT89C51与8255A实现数码管显示按键数值的C程序
#includereg51.h
#define PA8255 XBYTE[4000] //8255的A口地址
#define PB8255 XBYTE[4001] //8255的B口地址
#define PC8255 XBYTE[4002] //8255的C口地址
#define PD8255 XBYTE[4003] //8255的控制口地址
#define uchar unsigned char
#define uint unsigned int
uchar code table[]={
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x82,0xf8,
0x80,0x90,0x88,0x83,
0xc6,0xa1,0x86,0x8e,
0x00};
uchar li zhi ting( void );
void li(uchar xms )
{
uchar i,j;
for(i = xms; i0; i--)
for(j = 110; j0;j-- );
}
void main()
{
uchar key;
PD8255 = 0X81;
while(1)
{
PA8255 = 0;
li(100);
key = 16;
key = li
原创力文档

文档评论(0)