- #include<reg52.h>
- unsigned char code table[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,};//显示数字1-9
- void Delay(unsigned int t);//函数声明(就是这里不知道什么)
- void main (void)
- {
- unsigned char i;//定义一个无符号型局部变量i取值范围0-255
- while(1)
- {
- for(i=0;i<10;i++)
- {
- P2=table[i]; //循环调用表中的数值
- Delay(50000);
- }
- }
- }
- void Delay(unsigned int t)
- {
- while(--t);//这个也不知道是什么东东
- }
复制代码 |