1、畫74hc573圖和實驗板數(shù)碼管圖
2、編程實現(xiàn)控制573:
1)全部數(shù)碼管亮0~9任意數(shù)
2)任意數(shù)碼管亮0~9任意數(shù)
3)第一個數(shù)碼管0~9間隔1秒循環(huán)亮
3、發(fā)揮題
第一個數(shù)碼管亮1,第二個數(shù)碼管亮2,第三個數(shù)碼管亮3,
第四個數(shù)碼管亮4,第五個數(shù)碼管亮5,第六個數(shù)碼管亮6,
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)
單片機源程序如下:
- #include<reg52.h>
- sbit dula=P2^6;
- sbit wela=P2^7;
- void delayms(unsigned int xms){
- unsigned int i,j;
- for(i=xms;i>0;i--)
- for(j=110;j>0;j--);}
- unsigned char code table[]={
- ~0x3f,~0x06,~0x5b};
- void main(){
- dula=0;wela=0;
- while(1){
- P0=0x00; wela=1;wela=0;
- P0=~0x3f; dula=1;dula=0;
- P0=0x01; wela=1;wela=0;
- delayms(10);
- P0=0x00; wela=1;wela=0;
- P0=~0x06;dula=1;dula=0;
- P0=0x02; wela=1;wela=0;
- delayms(10);
- P0=0x00; wela=1;wela=0;
- P0=~0x5b; dula=1;dula=0;
- P0=0x04; wela=1;wela=0;
- delayms(10);
- }
- }
復制代碼
所有資料51hei提供下載:
單片機第四周作業(yè).zip
(17.17 KB, 下載次數(shù): 87)
2018-10-18 19:13 上傳
點擊文件名下載附件
時鐘
|