C语言编译提示error141,求助大佬,keil出现error c202编译错误 在线感谢

#include

#include

#define uchar unsigned char

#define uint unsigned int

#define delayNOP() {_nop_();_nop_();_nop_();_nop_();}

void LCD_Initialize();

void LCD_set_pos(ucgar);

void LCD_write_data(uchar);

void Display_String(uchar*,uchar);

sbit K1=P1^0;

sbit K2=P2^0;

sbit BEEP=P3^0;

sbit LCD_RS=P2^0;

sbit LCD_RW=P2^1 ;

sbit LCD_EN=P2^2;

uchar KeyCount=0;

uchar code msg1[]={"Second Watch 0"};

uchar code msg2[]={">>>>        "};

uchar code  prompts[][16]=

{

{"::1---->"},

{"::1---->::2"},

{"::1->2::3-->"},

{"::1->2::3->4"}

};

uchar Time_Buffer[]    ={0,0,0,0} ;

uchar LCD_Dispaly_Buffer[]={"00:00:00:00"};

void Beep()

{

uchar i,j=70;

for(i=0;i<180;i++)

{

while(--j);BEEP=~BEEP         ;

}

BEEP= 0 ;

}

void DelayX(uint ms)

{

uchar i;

while(ms--)for(i=0;i<120;i++);

}

void Show_second()

{

uchar i;

LCD_Set_POS(0x45);        //设置LCD显示起点

for(i=3;i!= 0xff ;i--)

{

LCD_Display_BUffer[2*i+1]=Time_Buffer[i]/10+'0';

LCD_Display_BUffer[2*i  ]=Time_Buffer[i]&10+'0';

LCD_write_Data(LCD_Display_Buffer[2*i+1])        ;

LCD_write_Data(LCD_Display_Buffer[2*i]);

LCD_write_Data (':');

}

}

void Time() interrupt 1 using         0

{

TH0         =-10000/256;

TLO    =-10000&256;

Time_Buffer[0]++;

if(Time_Buffer[0]==100)

{

Time_Buffer[0]=0;Time_Buffe[1]++;

}

if(Time_Buffer[1]==60)

{

Time_Buffer[1]=0;Time_Buffer[2]++;

}

if(Time_Buffer[2]==60)

{

Time_Buffer[2]=0;Time_Buffer[3]++;

}

if(Time_Buffer[3]==24)

Time_Buffer[3]        =0;;

}

void main ()

{

uchar i ;

IE=0x82

TMOD=0X01

THO=-10000/256        ;

TLO=-10000%256;

LCD_Initialize();

Display_string(msg1,0x00);

Display_string(msg2,0x40);

while(1)

{

if(K1==0)

{

DelayX(100);

i=++KeyCount;

switch(i)

{

case1;

case3;TRO=1;

Display_string(Prompts[i-1],0);

case2;

case4;TRO=0;

Display_string(Prompts[i-1],0);

break;

default :TRO =0;

break;

}

while (K1==0);

Beep();

}

else

if(K2==0)

{

TRO=0;

Keycount ;

for ( i=0 ;i<4;i++)

Time_Buffer[i]=0;

Display_String(msg1,0);

Beep();

DelayX(100);

while(K2==0);

}

show_Second();

}

}

#include  

#include  

#define  uchar  unsigned char

typedef unsigned char  INT8U;

#define   DelayNOP(){_nop_();_nop_();_nop_();_nop_();}

sbit LCD_RS=P2^0 ;

sbit LCD_RW=P2^1;

sbit LCD_EN=P2^2;

bit  LCD_BUSY_Check();

void  LCD_Tnitialize();

void  LCD_Set_Pos(uchar);

void  LCD_Write_Coommand(uchar);

void  LCD_Write_Data(uchar);

void DelayMS(uint  ms)

{

uchar t;

while(ms--)  for  (t=0  ;t<120;t++  );

}

bit LCD_Busy_check()

{

bit  Result;

LCD_RS  =0  ;  LCD_RW=1  ;LCD_EN=1;  DelayNOP();

Resullt = (bit)(P0&0x80);

LCD_EN=0;

return   Result;

}

void LCD_write_Command (uchar  cmd)

{

while (LCD_Busy_Check());

LCD_RS=0 ;LCD_RW=0 ; LCD_EN=0 ;

_nop_();  _nop_();

p0=cmd;  DelayNOP();

LCD_EN=1 ; DelayNOP();

LCD_EN=0 ;

}

void  LCD_Write_Data(uchar  str)

{

while (LCD_Busy_check());

LCD_RS=1;LCD_RW=0; LCD_EN=0; P0=STR; DelayNOP();

LCD_EN=1;  DelayNOP();  LCD_EN=0;

}

void LCD_Initialize()

{

DelayMS(5);LCD_Write_Command(0x38);

DelayMS(5);LCD_Write_Command(0x0c);

DelayMS(5);LCD_Write_Command(0x06);

DelayMS(5);LCD_Write_Command(0x01);

DelayMS(5);

}

void LCD_set_Pos(uchar Position)

{

LCD_Write_Command(Position  0x80);

}

void Display_String(uchar*str, uchar LineNo)

{

uchar  k;

LCD_Set_Pos(LineNo);

for  (k=0 ; k<16;k++)  LCD_write_Data(str[k]);

}

小胖胖的 2019/3/16/周六 18:42:40

for (i=3; i !=0xff;i--)

{

LCD_Display_Buffer[2*i+1]=Time_Buffer[i]/10+'0';

LCD_Display_Buffer[2*i  ]=Time_Buffer[i]&10+'0';

LCD_write_Data(LCD_Display_Buffer[2*i+1])        ;

LCD_write_Data(LCD_Display_Buffer[2*i]);

LCD_write_Data (':');

}

}

void Time() interrupt 1 using         0

{

TH0         =-10000/256;

TLO    =-10000&256;

Time_Buffer[0]++;

if(Time_Buffer[0]==100)

{

Time_Buffer[0]=0;Time_Buffe[1]++;

}

if(Time_Buffer[1]==60)

{

Time_Buffer[1]=0;Time_Buffer[2]++;

}

if(Time_Buffer[2]==60)

{

Time_Buffer[2]=0;Time_Buffer[3]++;

}

if(Time_Buffer[3]==24)

Time_Buffer[3]        =0;;

}

void main ()

{

uchar i ;

IE=0x82

TMOD=0X01

THO=-10000/256        ;

TLO=-10000%256;

LCD_Initialize();

Display_string(msg1,0x00);

Display_string(msg2,0x40);

while(1)

{

if(K1==0)

{

DelayX(100);

i=++KeyCount;

switch(i)

{

case1;

case3;TRO=1;

Display_string(Prompts[i-1],0);

case2;

case4;TRO=0;

Display_string(Prompts[i-1],0);

break;

default :TRO =0;

break;

}

while (K1==0);

Beep();

}

else

if(K2==0)

{

TRO=0;

Keycount ;

for ( i=0 ;i<4;i++)

Time_Buffer[i]=0;

Display_String(msg1,0);

Beep();

DelayX(100);

while(K2==0);

}

show_Second();

}

}

#include  

#include  

#define  uchar  unsigned char

typedef unsigned char  INT8U;

#define   DelayNOP(){_nop_();_nop_();_nop_();_nop_();}

sbit LCD_RS=P2^0 ;

sbit LCD_RW=P2^1;

sbit LCD_EN=P2^2;

bit  LCD_BUSY_Check();

void  LCD_Tnitialize();

void  LCD_Set_Pos(uchar);

void  LCD_Write_Coommand(uchar);

void  LCD_Write_Data(uchar);

void DelayMS(uint  ms)

{

uchar t;

while(ms--)  for  (t=0  ;t<120;t++  );

}

bit LCD_Busy_check()

{

bit  Result;

LCD_RS  =0  ;  LCD_RW=1  ;LCD_EN=1;  DelayNOP();

Resullt = (bit)(P0&0x80);

LCD_EN=0;

return   Result;

}

void LCD_write_Command (uchar  cmd)

{

while (LCD_Busy_Check());

LCD_RS=0 ;LCD_RW=0 ; LCD_EN=0 ;

_nop_();  _nop_();

p0=cmd;  DelayNOP();

LCD_EN=1 ; DelayNOP();

LCD_EN=0 ;

}

void  LCD_Write_Data(uchar  str)

{

while (LCD_Busy_check());

LCD_RS=1;LCD_RW=0; LCD_EN=0; P0=STR; DelayNOP();

LCD_EN=1;  DelayNOP();  LCD_EN=0;

}

void LCD_Initialize()

{

DelayMS(5);LCD_Write_Command(0x38);

DelayMS(5);LCD_Write_Command(0x0c);

DelayMS(5);LCD_Write_Command(0x06);

DelayMS(5);LCD_Write_Command(0x01);

DelayMS(5);

}

void LCD_set_Pos(uchar Position)

{

LCD_Write_Command(Position  0x80);

}

void Display_String(uchar*str, uchar LineNo)

{

uchar  k;

LCD_Set_Pos(LineNo);

for  (k=0 ; k<16;k++)  LCD_write_Data(str[k]);

}

  • 0
    点赞
  • 0
    收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:游动-白 设计师:我叫白小胖 返回首页
评论
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值