|
这是一份程序
- #include <reg51.h>
- #define uchar unsigned char
- uchar segData[10]={0x06,0x7d,0x6d,0x4f,0x3f,0x7d,0x06,0x66,0x6d};
- void delay()
- {
- uchar i,j,k;
- for(i=0;i<5;i++)
- for(j=0;j<200;j++)
- for(k=0;k<200;k++);
- }
- void main()
- {
- uchar i;
- P1=0x00;delay();
- P1=0x00;delay();
- while(1)
- {
- for(i=0;i<10;i++)
- {
- P1=segData[i];
- delay();
- }
- /*
- P1=segData[0];
- delay();
- P1=segData[1];
- delay();
- P1=segData[2];
- delay();
- P1=segData[3];
- delay();
- P1=segData[4];
- delay();
- P1=segData[5];
- delay();
- P1=segData[6];
- delay();
- P1=segData[7];
- delay();
- P1=segData[8];
- delay();
- */
- }
- }
复制代码
|
-
-
ORG.rar
350 Bytes, 下载次数: 2, 下载积分: 黑币 -5
数码管
|