下面的程序除了什么问题
编译提示
LCD1602.C(24): error C141: syntax error near ')'
LCD1602.C(27): error C141: syntax error near 'data'
LCD1602.C(53): error C211: call not to a function
LCD1602.C(60): error C211: call not to a function
LCD1602.C(60): error C208: 'function': too many actual parameters
#include<reg52.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
sbit RS=P2^6;
sbit RW=P2^5;
sbit EP=P2^7;
uchar num;
uchar code table[]="123456";
uchar code table123[]="abcdef";
void LcdWriteCom(uchar com)
{
RS=0;
P0=com;
_nop_();
_nop_();
EP=1;
_nop_();
_nop_();
EP=0;
}
void LcdWriteData(uchar data)
{
RS=1;
P0=data;
_nop_();
_nop_();
EP=1;
_nop_();
_nop_();
EP=0;
}
void init()
{
RS=0;
RW=0;
EP=0;
LcdWriteCom(0x38);
LcdWriteCom(0x0c);
LcdWriteCom(0x06);
LcdWriteCom(0x01);
LcdWriteCom(0x80);
}
void main()
{
init();
for(num=0;num<7;num++)
{
LcdWriteData(table(num));
_nop_();
_nop_();
}
LcdWriteCom(0x80+0x40);
for(num=0;num<7;num++)
{
LcdWriteData(table123(num));
_nop_();
_nop_();
}
while(1);
}
此帖出自
小平头技术问答
恩,学习了!
一周热门 更多>