#include "reg52.h"
#define uint unsigned int
#define uchar unsigned char
uchar code table[]={
0x3f,0x06,0x5b,0x4f,
0x66,0x6d,0x7d,0x07,
0x7f,0x6f,0x77,0x7c,
0x39,0x5e,0x79,0x71,
};
uchar num,num1;
void delay(uint);
void main()
{
while(1)
{
num++;
P0=table[num];
delay(1000);
}
}
void delay(uint z)
{
uint i;
for(;z>0;z--)
{
for(i=0;i<124;i++);
}
为什么程序运行时P0的值一直为0不变化,请问怎么才能让P0不断读取table[]里的值?放入!
} |