- 10
- 0
- 约小于1千字
- 约 9页
- 2020-01-18 发布于湖北
- 举报
单片机控制技术;单片机控制技术
两位数码管显示变量值;单片机控制技术
两位数码管显示变量值; 三、数码管显示编程;建立数组存放
字型码
数组引用
驱动显示
多位数字显示;#includeat89x51.h
unsigned char seg[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
void delay()
{ unsigned int j;
for(j=0;j30000;j++);
}
void main()
{ unsigned char i;
while(1)
{ for(i=0;i100;i++)
{ P0=seg[i/10];
P2=seg[i%10];
delay();
}
}
};仿真电路如图,可循环显示“00-99”。;拓展仿真电路:
(共阴数码管);
原创力文档

文档评论(0)