标题:
1602.c(10): error C129: missing ';' before 'Convert' 求解答
[打印本页]
作者:
w23
时间:
2020-3-25 21:01
标题:
1602.c(10): error C129: missing ';' before 'Convert' 求解答
#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++;
}
}
作者:
csmyldl
时间:
2020-3-26 00:56
是因为你的程序中没有说明uchar,只要在前面加一行: #define uchar unsigned char就可以了
作者:
白幽幽
时间:
2020-3-26 12:14
增添一下,如果使用uint,就加#define uint unsigned int
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1