找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 784|回复: 1
打印 上一主题 下一主题
收起左侧

compiling 4Check_Busy': missing functio...

[复制链接]
跳转到指定楼层
楼主
ID:982112 发表于 2021-11-18 10:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#include<reg52.h>
#include<intrins.h>

sbit RS= P1^0;
sbit RW= P1^1;
sbit EN= P2^5;

#define RS_CLR RS=0
#define RS_SET RS=1

#define RW_CLR RW=0
#define RW_SET RW=1

#define EN_CLR EN=0
#define EN_SET EN=1

#define Dataport P0

void DelayUs2x(unsigned char t)
     {  
       while(--t);
         }
         void        DelayMs(unsigned char t )
         {
             while (t--)
                 {
                   DelayUs2x(245);
                    DelayUs2x(245);
                  }
                  }
                  bit LCD_check_Busy(void)
                  {
                   RS_CLR;
                   RW_SET;
                   EN_CLR;
           _nop_();
               EN_SET;
           return (bit)(Dataport & 0x80);
           }




           void LCD_Write_Com(unsigned char com)
           {
                while (LCD_Check_Busy());
                        RS_CLR;
                        RW_CLR;
                        EN_SET;
                        Dataport=com;
                        _nop_();
                        EN_CLR;
                        }
             void LCD_Write_Date(unsigned char Date)
                        {
                          while(LCD_Check_Busy());
                            RS_SET;
                                RW_CLR;
                            EN_SET;
                                Dataport=Date;
                                _nop_();
                                EN_CLR;
                                }


                        void LCD_Write_String(unsigned char x,unsigned char y , unsigned char *s)
                        {
                               if(y==0)
                                   {  
                                      LCD_Write_Com(0x80 +x);
                                          }
                                           else
                                           {
                                             LCD_Write_Com(0xC0 + x);
                                                 }
                                                 while (*s)
                                                 {
                                        LCD_Write_Date(  *s);
                                        }
                                        }
                                       
                                         
                                        void LCD_Write_char (unsigned char x, unsigned char y, unsigned char Data)
                                        {
                                            if (y==0)
                                                {
                                                   LCD_Write_Com(0x80 + x);
                                                   }  
                                                   else
                                                   {
                                                     LCD_Write_Com(0xC0 +x);
                                                         }
                                                         LCD_Write_Date (Data);
                                                         }
                                                         void LCD_Init(void)
                                                         {
                                                         LCD_Write_Com(0x38);
                                                         DelayMs (5);

                                                          LCD_Write_Com(0x38);
                                                         DelayMs (5);
                                                         
                                                          LCD_Write_Com(0x38);
                                                         DelayMs (5);

                                                          LCD_Write_Com(0x38);

                                                          LCD_Write_Com(0x08);;

                                                          LCD_Write_Com(0x01);

                                                          LCD_Write_Com(0x06);
                                                          DelayMs (5);
                                                          LCD_Write_Com(0x0C);
                                        }
                                        void main(void)
                                        {
                                          LCD_Init();
                                          LCD_Clear();
                                          while (1)
                                          {
                                          LCD_Write_Char (7,0,'O');
                                          LCD_Write_Char (8,0,'k');
                                          LCD_Write_String  (1,1 "hello word");
                                          while (1);
                                          }
                                          }

一直显示
Build target '目标 1'
compiling 44.C...
44.C(46): warning C206: 'LCD_Check_Busy': missing function-prototype
44.C(119): warning C206: 'LCD_Clear': missing function-prototype
44.C(122): warning C206: 'LCD_Write_Char': missing function-prototype
44.C(122): error C267: 'LCD_Write_Char': requires ANSI-style prototype
44.C(124): error C141: syntax error near '<string>'
目标未创建

求解

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:277550 发表于 2021-11-18 13:27 | 只看该作者

调用 LCD_Check_Busy 和 LCD_Write_Char 的大小写不对应。
应该仔细检查
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表