#include unsigned char DisBuf[8]; void DisBrush(void) { code unsigned char cathode[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}; code unsigned char Seg7Code[16]= {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71}; static unsigned char i=0; P2 = 0xff; P1 = Seg7Code[ DisBuf] ]; P2 = cathode[ i ]; if( ++i >= 8 ) i=0; }
void Timer0IntRoute( void ) { TL0 = -1000; TH0 = (-1000)>>8; DisplayBrush(); }
void Timer0Init( void ) { TMOD=(TMOD & 0xf0) | 0x01; TL0 = -1000; TH0 = (-1000)>>8; TR0 = 1; ET0 = 1; }
void Display( unsigned char index, unsigned char dataValue ) { DisBuf[ index ] = dataValue; }
void main( void ) { unsigned char i; for( i=0; i<8; i++ ){ Display(i, 8-i); } //DisBuf[0]为右DisBuf[7]为左 Timer0Init(); // Timer0Init() redefinition EA = 10; // EA redefinition while(1); // systax error near while ,syntax error near 1
编译时: 在上边的语句行出现右边蓝色的错误提示:想破脑袋啊 ,请朋友们指点指点
|