(1)字库问题
编写字库头文件:#ifndef __ZIKU_H__
unsigned char code guang[]={
0x00,0x00,0xFC,0x04,0x04,0x04,0x04,0x05,0x06,0x04,0x04,0x04,0x04,0x04,0x04,0x00,
0x40,0x30,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
} //广
unsigned char code zhou[]={
0x00,0xE0,0x00,0x00,0xFF,0x20,0xC0,0x00,0xFE,0x10,0x60,0x80,0x00,0xFF,0x00,0x00,
0x01,0x80,0x60,0x18,0x07,0x00,0x00,0x00,0x7F,0x00,0x00,0x01,0x00,0xFF,0x00,0x00,
} //州
unsigned char code hui[]={
0x00,0x02,0x02,0xFA,0xAA,0xAA,0xAA,0xFF,0xAA,0xAA,0xAA,0xFA,0x02,0x02,0x00,0x00,
0x00,0x42,0x72,0x02,0x3A,0x42,0x42,0x4B,0x52,0x42,0x62,0x02,0x13,0x66,0x00,0x00,
} //恵
unsigned char code he[]={
0x00,0x20,0x24,0x24,0x24,0xA4,0x64,0xFC,0x62,0xA2,0x22,0x23,0x22,0x30,0x20,0x00,
0x20,0x10,0x08,0x04,0x02,0x01,0x00,0xFF,0x00,0x01,0x02,0x0C,0x18,0x30,0x10,0x00,
} //禾
usigend char code dian[]={
0x00,0x00,0xF8,0x48,0x48,0x48,0x48,0xFF,0x48,0x48,0x48,0x48,0xF8,0x00,0x00,0x00,
0x00,0x00,0x0F,0x04,0x04,0x04,0x04,0x3F,0x44,0x44,0x44,0x44,0x4F,0x40,0x70,0x00,
} //电
unsigned char code zi[]={
0x00,0x00,0x02,0x02,0x02,0x02,0x02,0xE2,0x12,0x0A,0x06,0x02,0x00,0x80,0x00,0x00,
0x01,0x01,0x01,0x01,0x01,0x41,0x81,0x7F,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,
} //子
unsigned char code ke[]={
0x10,0x12,0x92,0x72,0xFE,0x51,0x91,0x00,0x22,0xCC,0x00,0x00,0xFF,0x00,0x00,0x00,
0x04,0x02,0x01,0x00,0xFF,0x00,0x04,0x04,0x04,0x02,0x02,0x02,0xFF,0x01,0x01,0x00,
} //科
unsigned char code ji[]={
0x08,0x08,0x88,0xFF,0x48,0x28,0x00,0xC8,0x48,0x48,0x7F,0x48,0xC8,0x48,0x08,0x00,
0x01,0x41,0x80,0x7F,0x00,0x40,0x40,0x20,0x13,0x0C,0x0C,0x12,0x21,0x60,0x20,0x00,
} //技
#endif
编译出现:ZIKU.H(7): error C141: syntax error near 'unsigned'
ZIKU.H(11): error C141: syntax error near 'unsigned'
ZIKU.H(15): error C141: syntax error near 'unsigned'
ZIKU.H(19): error C141: syntax error near 'usigend'
ZIKU.H(23): error C141: syntax error near 'unsigned'
ZIKU.H(27): error C141: syntax error near 'unsigned'
ZIKU.H(31): error C141: syntax error near 'unsigned'
(2)编译问题
#include"intrins.h"
#include"ZIKU.h"
#define LCD_DATA P2 //8 bit数据线
sbit RS=P0^0; //数据/命令选择
sbit RW=P0^0; //读写控制
sbit EN=P1^7; //片选信号
sbit CS1=P0^3;
sbit CS2=P0^4;
//*****************************************************************
//函数名称:writeCmd(uchar value)写指令
//入口参数:value
//返回参数:无
//*****************************************************************
void WriteCmd(uchar value)
{
ReadBusy();
RS = 0;
RW = 0;
LCD_DATA=value;
EN=1;
_nop_();
_nop_();
EN=0;
}
编译出现:
LCD_DRIVE.H(11): error C141: syntax error near 'sbit'
LCD_DRIVE.H(11): error C247: non-address/-constant initializer
LCD_DRIVE.H(22): error C141: syntax error near 'value', expected ')'
实在是想不通。
|