#include<reg52.h>
unsigned int code LedChar[]={
0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,
0x80,0x90,0x88,0x83,0xc6,0xa1,0x86,0x8e
};
void main()
{
unsigned int sec = 0;
while(1)
{
if(sec<=16)
{
P0=LedChar[sec];
InitTimer0();
sec++;
}
sec=0;
}
}
void InitTimer0(void)
{
TMOD = 0x01;
TH0 = 0x0EE;
TL0 = 0x00;
TR0 = 1;
}
错误提示:
Rebuild target 'Target 1'
assembling STARTUP.A51...
compiling 静态显示代码.c...
静态显示代码.c(17): warning C206: 'InitTimer0': missing function-prototype
静态显示代码.c(26): error C231: 'InitTimer0': redefinition
静态显示代码.c(31): error C231: 'InitTimer0': redefinition
Target not created.
Build Time Elapsed: 00:00:01
我这个InitTimer0函数是用单片机小精灵算出来的,难道还有错不成?
|