完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
#ifndef __LCD12864_H
#define __LCD12864_H #include #include //---重定义关键词---// #ifndef uchar #define uchar unsigned char #endif #ifndef uint #define uint unsigned int #endif #ifndef data12864 #define data12864 P0 #endif ***it RS = P2^0; ***it RW = P2^1; ***it E = P2^2; ***it rst_12864 = P2^3; unsigned char read12684_data(uchar address);//12864读数据 void busychk_12864(void);//12864,忙碌检查 void write12864_comand(uchar comand);//12864写命令 void write12864_data(uchar dat);//12864写数据 void initial_12864(); //12864初始化 void clear_CGRAM12864();//清空CGRAM void delay_12864(uint a); void write12864_address(uchar x,uchar y);//地址设置 第x行 第y列 void ShowStringPos(uchar x, uchar y,uchar *s);//写英文字符串,一行写满自动换行 void ShowGBString(uchar x, uchar y, uchar *s);//显示多个汉字 uchar code wendu[] = {"温度: 66.6 ℃"}; uchar code shidu[] = {"湿度: 66.6 %"}; uchar code mima[] = {"请输密码"}; uchar code succeed[]={"密码输入正确"}; uchar code fail[]={"密码输入错误"}; uchar code kaiji[]={/*-- 调入了一幅图像:C:UsersAdministratorPictures无标题.bmp --*/ /*-- 宽度x高度=128x64 --*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00, 0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00, 0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00, 0x00,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00, 0x0F,0xCF,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xF3,0xE0, 0x06,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x40, 0x01,0x86,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80, 0x00,0x84,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00, 0x01,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00, 0x01,0xCE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2D,0x00, 0x03,0x03,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x80, 0x00,0x04,0x00,0x00,0x00,0x18,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,}; uchar code ren[]={/*-- 调入了一幅图像:C:UsersAdministratorPicturesuser9_16x16.bmp --*/ /*-- 宽度x高度=16x16 --*/ 0x07,0xE0,0x0F,0xF0,0x1F,0xF8,0x18,0x38,0x18,0x38,0x1C,0x78,0x1F,0xF8,0x0F,0xF0, 0x07,0xE0,0x0F,0xF0,0x14,0x38,0x13,0xF8,0x10,0x78,0x10,0x78,0x10,0x78,0x0F,0xF0} #endif #include "lcd12864.h" void busychk_12864(void) //忙碌检测 { uchar busytemp = 0x80; E = 0; RW = 1; RS = 0; E = 1; while((busytemp & data12864)); E = 0; } Build target 'Target 1' compiling iMAIN.c... DHT11.H(16): error C141: syntax error near 'void' iMAIN.c(80): warning C316: unterminated conditionals compiling LCD12864.c... LCD12864.C(2): error C141: syntax error near 'void' LCD12864.C(3): error C231: 'busychk_12864': redefinition LCD12864.C(3): error C141: syntax error near '{' LCD12864.C(5): error C231: 'E': redefinition LCD12864.C(5): error C231: 'E': redefinition LCD12864.C(6): error C231: 'RW': redefinition LCD12864.C(6): error C231: 'RW': redefinition LCD12864.C(7): error C231: 'RS': redefinition LCD12864.C(7): error C231: 'RS': redefinition LCD12864.C(8): error C279: 'E': multiple initialization LCD12864.C(8): error C231: 'E': redefinition LCD12864.C(8): error C231: 'E': redefinition LCD12864.C(9): error C141: syntax error near 'while' LCD12864.C(9): error C141: syntax error near '&', expected ')' LCD12864.C(9): error C129: missing ';' before ')' Target not created 不是所有程序,第一段是头文件,第二段是lcd12864程序的第一个子程序,在这个子程序开始就报错了 |
|
相关推荐
5个回答
|
|
对头文件不熟,是不是跨文件调用没有加extern
|
|
|
|
|
|
|
|
while((busytemp & data12864));多了一对括号
|
|
|
|
redefinition的错误是你在多个文件里定义了同样的一个名称,查查所有的程序和头文件吧
|
|
|
|
可能是同时包含了reg51和reg52
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
726 浏览 0 评论
777 浏览 1 评论
基于瑞萨FPB-RA4E2智能床头灯项目——1编译环境搭建与点亮驱动ws2812全彩LED
680 浏览 0 评论
嵌入式学习-飞凌嵌入式ElfBoard ELF 1板卡-LCD显示图片编程示例之介绍mmap
1149 浏览 0 评论
《DNESP32S3使用指南-IDF版_V1.6》第二章 常用的C语言知识点
1120 浏览 0 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
11800 浏览 31 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 07:02 , Processed in 0.692138 second(s), Total 77, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号