基于单片机的动态数码显示电路设计

嵌入式系统 时间:2013-01-23来源:网络

  7. C 语言源程序

  #include AT89X51.H>

  unsigned char code table1[]={0x06,0x5b,0x4f,0x66,0x6d};

  unsigned char code table2[]={0x78,0x79,0x38,0x38,0x3f};

  unsigned char i;

  unsigned char a,b;

  unsigned char temp;

  void main(void)

  {

  while(1)

  {

  temp=0xfe;

  for(i=0;i5;i++)

  {

  if(P1_7==1)

  {

  P0=table1[i];

  }

  else

  {

  P0=table2[i];

  }

  P2=temp;

  a=temp(i+1);

  b=temp>>(7-i);

  temp=a|b;

  for(a=4;a>0;a--)

  for(b=248;b>0;b--);

  }

  }

参考文献:

[1].SP1 datasheethttp://www.dzsc.com/datasheet/SP1+_1182399.html.

1 2 3

关键词: 单片机 动态数码显示 动态接口

加入微信
获取电子行业最新资讯
搜索微信公众号:EEPW

或用微信扫描左侧二维码

相关文章

查看电脑版