找回密码
 立即注册

QQ登录

只需一步,快速开始

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

1602.c(10): error C129: missing ';' before 'Convert' 求解答

[复制链接]
跳转到指定楼层
楼主
ID:636918 发表于 2020-3-25 21:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#include "1602.h"
#include "math.h"

         void delay(){
         int i,j;
         for(i=0;i<=10;i++)        ;
         for(j=0;j<=2;j++)        ;
         }

         uchar Convert(uchar In_Date){
          
                 uchar i,Out_Date=0,temp=0;
                 for(i=0;i<8;i++) {
                 temp=(In_Date>>i)&&0x01;
                 Out_Date|=(temp<<(7-i));
                 }
                 return Out_Date;
               
                 return In_Date;
         }

         void enable (uchar del){
         P0=Convert(del);
         RS=0;
         RW=0;
         E=0;
         delay();
         E=1;
         delay();
         }

         void write(uchar del){
         p0=Convert(del);
         RS=1;
         RW=0;
         E=0;
         delay();
         E=1;
         delay();
         }

         void L1602_init(void){
         enable(0x01);
         enable(0x38);
         enable(0x0c);
         enable(0x06);
         enable(0xd0);
                         }

        void L1602_char(uchar hang,uchar lie,uchar sign){
           uchar=a;
           if(hang==1) {
                   a=0x80
                   }
           if(hang==2) {
                   a=0xc0;
                   }
           a=a+lie-1;
           enable(a);
           write(sign);
        }

        void L1602_string(uchar hang,uchar lie,uchar *p){
        uchar a;
        if(hang==1){
                a=0x80;
          }
        if(hang==2){
           a=0xc0;
          }        
        a=a+lie-1;
        enable(a);
        write(1){
        if(*p=="\0")
        break;
        write(*p);
        p++;
                }
}       

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

使用道具 举报

沙发
ID:235200 发表于 2020-3-26 00:56 | 只看该作者
是因为你的程序中没有说明uchar,只要在前面加一行:  #define uchar unsigned char就可以了
回复

使用道具 举报

板凳
ID:716109 发表于 2020-3-26 12:14 | 只看该作者
增添一下,如果使用uint,就加#define uint unsigned int
回复

使用道具 举报

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

本版积分规则

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

Powered by 单片机教程网

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