数码管单片机c语言程序设计.docVIP

  • 15
  • 0
  • 约8.49千字
  • 约 22页
  • 2017-03-22 发布于江苏
  • 举报
数码管单片机c语言程序设计

数码管单片机c语言程序设计 1、一个管亮《静态》 #includereg52.h #define uint unsigned int #define uchar unsigned char sbit Wela=P2^1; sbit Dula=P2^2; void main(void) { Wela=1; P0=0xfe; Wela=0; Dula=1; P0=0x7d; Dula=0; while(1); } 2、一个管亮《动态》 #includereg52.h #define uint unsigned int #define uchar unsigned char void Delay_Us(uchar t); void Delay_Ms(uint t); sbit Wela=P2^1; sbit Dula=P2^2; uchar num; uchar code table2[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; uchar code table1[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}; void main(void) { while(1) {

文档评论(0)

1亿VIP精品文档

相关文档