集成式数码管动态扫描显示
2016-12-14 / 电子技术 / 1948 次围观 / 0 次吐槽 /#include<reg52.h> #define INT8U unsigned char #define INT16U unsigned int code INT8U SEG_CODE[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}; code INT8U array[]={2,0,1,5,1,2,1,4}; void delay_ms(INT16U x){ INT8U t; while(x--) for(t=0;t<120;t++); } void main(){ INT8U i; while(1){ for(i=0;i<8;i++){ P0=0xff; P2=1<<i; P0=SEG_CODE[array[i]]; delay_ms(4); } } }
- 上一篇:PCB_触摸延时开关
- 下一篇:按键调节数码管数字显示
Powered By Cheug's Blog
Copyright Cheug Rights Reserved.