Chinaunix首页 | 论坛 | 博客
  • 博客访问: 311311
  • 博文数量: 69
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 759
  • 用 户 组: 普通用户
  • 注册时间: 2014-09-09 14:15
个人简介

〆 人生就是拼命地奔跑,和华丽的跌倒。 つ

文章分类

全部博文(69)

文章存档

2017年(2)

2016年(16)

2015年(21)

2014年(30)

分类: C/C++

2015-04-05 22:32:46

<7-SEGMPX4_CC共阴>:

点击(此处)折叠或打开

  1. #include <reg51.h>

  2. void delay_ms()
  3. {
  4.     int i,j;
  5.     for(i=102;i>0;i--)
  6.     {
  7.         for(j=3;j>0;j--)
  8.         {
  9.         }
  10.     }
  11. }
  12. int main()
  13. {
  14.     int i,j,k,n;
  15.     int count=20;
  16.     unsigned char SEG_CC[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};
  17.     for(n=0;n<10;n++)
  18.     {
  19.         for(k=0;k<10;k++)
  20.         {
  21.             for(i=0;i<10;i++)
  22.             {
  23.                 for(j=0;j<10;j++)
  24.                 {
  25.                     count=20;
  26.                     while(count>0)
  27.                     {
  28.                         P2=0xfe;
  29.                         P0=SEG_CC[n];
  30.                         delay_ms();

  31.                         P2=0xfd;
  32.                         P0=SEG_CC[k];
  33.                         delay_ms();
  34.                      
  35.                         P2=0xfb;
  36.                         P0=SEG_CC[i];
  37.                         delay_ms();    

  38.                         P2=0xf7;
  39.                         P0=SEG_CC[j];
  40.                         delay_ms();    
  41.                     
  42.                           count--;
  43.                     }
  44.                 }
  45.             }
  46.         }
  47.     }
  48. }

运行结果:
阅读(1375) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~