完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
#include
#include #define DATAPORT P1 #define RS = P2^5 #define RW = P2^6 #define E = P2^7 unsigned char Busy_Check() { unsigned char LCD_Status; RS = 0; RW = 1; E = 1; delayMS(1); LCD_Status = P1; E = 0; return LCD_status; } void Write_LCD_Command(unsigned char cmd) { while(Busy_Check()&0x80); RS = 0; RW = 0; E = 0; P1 = cmd; E = 1; delayMS(1); E = 0; } viod Write_LCD_Data(unsigned char dat) { while(Busy_Check()&0x80 == 0x80); RS = 1; RW = 0; E = 0; P1 = dat; E = 1; delayMS(1); E = 0; } viod Initialize_LCD() { Write_LCD_Command(0x38); delayMS(1); Write_LCD_Command(0x01); delayMS(1) Write_LCD_Command(0x06); delayMS(1); Write_LCD_Command(0x0c); delayMS(1); } viod ShowString(unsigned char x, unsigned char y, unsigned char *str) { unsigned char i = 0; if(y == 0) Write_LCD_Command(0x80|x); if(y == 1) Write_LCD_Command(0xc0|x); for(i = 0; i < 16; i++) { Write_LCD_Data(str); } } main(viod) { unsigned char code Promt[]="HELLO WORLD! 2016-04-25"; Initalize_lcd(); ShowString(0,0,Prompt); ShowString(0,1,Prompt+16); while(1) } 编译时keil4提示错误错误代码 compiling lesson1.c... LESSON1.C(10): error C141: syntax error near '=' LESSON1.C(10): error C141: syntax error near '=' LESSON1.C(11): error C141: syntax error near '=' LESSON1.C(11): error C141: syntax error near '=' LESSON1.C(12): error C141: syntax error near '=' LESSON1.C(12): error C141: syntax error near '=' lesson1.c - 6 Error(s), 0 Warning(s). 请高手看看是哪里错了 |
|
相关推荐
3个回答
|
|
#define RS = P2^5
#define RW = P2^6 #define E = P2^7 这个有错误,你可以试试把这个改成位定义,即就是#define改为***it |
|
|
|
谢谢 已经改了 |
|
|
|
定义管脚怎么是宏定义,位***it定义试一试
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
飞凌嵌入式-ELFBOARD 解决PCB布线时无法捕捉到焊盘中心的问题
176 浏览 0 评论
Openharmony软件评估指南-米尔瑞芯微RK3568开发板
700 浏览 0 评论
STM32CUBEMX(7)--移植雅特力AT32F403AVGT(兼容STM32F103VGT6),DAC输出电压
1097 浏览 0 评论
【RA-Eco-RA0E1-32PIN-V1.0开发板试用】开发板简介与上电测试
1004 浏览 0 评论
嵌入式学习-飞凌嵌入式ElfBoard ELF 1板卡-shell脚本编写之传参
555 浏览 0 评论
【youyeetoo X1 windows 开发板体验】少儿AI智能STEAM积木平台
11051 浏览 31 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-9-11 09:53 , Processed in 0.644159 second(s), Total 76, Slave 58 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191