141错误 打死也找不到..求帮助

2019-03-24 19:08发布

sbit LCDRS=P3^4;
sbit LCDRW=P3^3;
sbit LCDEN=P3^2;
sbit LCDRST=P3^0;
sbit LCDPSB=P3^1;
uchar data z;
uchar data y;
uchar data column;
uchar data page;
uchar *p2;
uchar wbyte;
void delayms(uint z)  //ÑÓ³Ùº¯Êý£¬MS¼¶ÑÓ³Ù¡£
{
uint data i,j;
for(i=0;i<z;i++)
  {
    for(j=0;j<600;j++)
     {;}
   }
} void write_com(uchar com)
{
 uchar temp=0;
 LCDRS=0; //  ֮ǰÊÇ0£»
 LCDRW=1;
 do
 {
  LCDEN=1;
  delayms(1);
  temp=P2;
  LCDEN=0;
 }
 while(temp&0x80);  LCDRW=0;
 P2=com;
 LCDEN=1;
 delayms(1);
 LCDEN=0;
} void write_date(uchar date)
{
 uchar temp=0;
 LCDRS=0;
 LCDRW=1;
 do
 {
  LCDEN=1;
  delayms(1);
  temp=P2;
  LCDEN=0;
 }
 while(temp&0x80);  LCDRS=1; //¸Ä³ÉдÊý¾ÝÁË¡£Ö®Ç°ÊÇ1.д´í¡£
 LCDRW=0;
 P2=date;
 LCDEN=1;
 delayms(1);
 LCDEN=0;
} void clearlcd1()
{
 uchar  i;
 uchar  j;
 for(i=0;i<64;i++)
 {
  write_com(i|0x80);
  write_com(0x80);
  for(j=0;j<32;j++)
  {
   write_date(0x00);
  }
 }
} void picture()
{
 uchar  v;
 uchar  w;
 uchar  x;
 uchar  h;
 write_com(0x34);
 write_com(0x36);
 for(h=0;h<32;h++)
 {
  v=column|0x80;
  w=page|0x80;
  write_com(w);
  write_com(v);
  page++;
  for(x=0;x<4;x++)
  {
   wbyte=*p2;
   write_date(wbyte);
   p2++;
  }
 } }
void init()
{
 LCDRST=1;
 write_com(0x30);  //»ù±¾Ö¸Á
 delayms(1);
 write_com(0x02);   //µØÖ·¹éλ
 delayms(1);
 write_com(0x0c);   /  /ÕûÌåÏÔʾ´ò¿ª Óαê¹Ø±Õ
 delayms(1);
 write_com(0x02);    //Çå³ýÏÔʾ
 delayms(1);
 write_com(0x02);//¹â±ê´ÓÓÒÏò×ó¼ÓһλÒƶ¯
}
void lock()
{
 clearlcd1();
 column=3;
 page=1;
 const uchar code clocker_32_4[]=
 {
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x00,
 0x00,0xFF,0xFF,0x00,0x00,0xC0,0x03,0x00,0x00,0xC0,0x03,0x00,0x03,0xFF,0xFF,0xC0,
 0x07,0xFF,0xFF,0xE0,0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,
 0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,
 0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,
 0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,
 0x06,0x00,0x00,0x60,0x06,0x00,0x00,0x60,0x07,0xFF,0xFF,0xE0,0x03,0xFF,0xFF,0xC0,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
 };
  //这里出现 C141 syntax error
 p2=clocker_32_4[];
 picture();
}
void main()
{
 uchar temp1[]={"--¡æ "};
 uchar temp2[]={"³ý¹¸"};
 uchar temp3[]={"--ml "};
 uchar temp4[]={"ÖÆË®ÖÐ"};  int i=0;  LCDPSB=1;
 init();
 write_com(0x80);//É趨λÖÃΪµÚÒ»ÐеĵÚһλ
 for(i=0;i<4;i++)
  write_date(temp1);  write_com(0x86);//É趨λÖÃΪµÚÒ»Ðеĵڶþλ
 for(i=0;i<2;i++)
  write_date(temp2);  write_com(0x98);//É趨λÖÃΪµÚÒ»ÐеĵÚÈýλ
 for(i=0;i<5;i++)
  write_date(temp3);  write_com(0x9e);//É趨λÖÃΪµÚÒ»ÐеĵÚËÄλ
 for(i=0;i<3;i++)
  write_date(temp4);  lock();
 while(1);//³ÌÐòÍ£Ö¹
} 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
3条回答
maylove
1楼-- · 2019-03-24 22:37
这有部分显示是乱码
yongpeiyuan
2楼-- · 2019-03-24 23:53
 精彩回答 2  元偷偷看……
jishuaihu
3楼-- · 2019-03-25 04:14
变量的定义要放在语句之前。数组的定义放在函数外面就可以了吧,为什么放在函数里面呢?

一周热门 更多>