完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
#ifndef TFT_H
#define TFT_H ***it TFT_RS = P2^0; ***it TFT_WR = P2^1; ***it TFT_CS = P2^2; #define TFT_Data P0 //---TFT寄存器定义--- //#define I 3fh //#define J 40h //#define K 41h #define VH 42h #define VL 43h #define colorH 44h #define colorL 45h void TFT_Write_Bus(); void Address_set(); void paint(); void ignu2(uint color); //----- void TFT_Write_Bus(){//发送数据给TFT, 输入VH, VL. 先发低位后高位 TFT_Data=VL; TFT_WR=0; TFT_CS=1; TFT_CS=0; TFT_WR=1; TFT_Data=VH; TFT_WR=0; TFT_CS=1; TFT_CS=0; TFT_WR=1; } void Address_set(){//TFT初始化 VH=0; VL=0; TFT_RS=0; TFT_CS=0; TFT_Write_Bus(); //x起始地址 VH=0; VL=0; TFT_Write_Bus(); //y起始地址 } void paint(){ uchar i,k; TFT_CS=0; Address_set(); TFT_RS=1; VH=colorH; VL=colorL; for(k=0;k<160;k++) for(i=0;i<240;i++){ TFT_Write_Bus(); TFT_Write_Bus(); } TFT_CS=1; } void ignu2(uint colortmp){ colorH=0x0; colorL=0x0; paint(); } #endif 报错如下: Build target '目标 1' compiling G.c... TFT.H(24): error C141: syntax error near 'h' TFT.H(24): error C202: 'h': undefined identifier TFT.H(30): error C141: syntax error near 'h' TFT.H(30): error C202: 'h': undefined identifier TFT.H(37): error C141: syntax error near 'h' TFT.H(37): error C202: 'h': undefined identifier TFT.H(38): error C141: syntax error near 'h' TFT.H(38): error C202: 'h': undefined identifier TFT.H(42): error C141: syntax error near 'h' TFT.H(42): error C202: 'h': undefined identifier TFT.H(43): error C141: syntax error near 'h' TFT.H(43): error C202: 'h': undefined identifier TFT.H(52): error C141: syntax error near 'h' TFT.H(52): error C202: 'h': undefined identifier TFT.H(52): error C141: syntax error near 'h' TFT.H(53): error C141: syntax error near 'h' TFT.H(53): error C202: 'h': undefined identifier TFT.H(53): error C141: syntax error near 'h' TFT.H(63): error C141: syntax error near 'h' TFT.H(63): error C202: 'h': undefined identifier TFT.H(64): error C141: syntax error near 'h' TFT.H(64): error C202: 'h': undefined identifier 这是什么意思呢?'h'哪来的???求高手求解谢谢~! |
|
相关推荐
8个回答
|
|
#define VH 42h
#define VL 43h #define colorH 44h #define colorL 45h 改成下面就好了汇编改c语言真累~! #define VH (*((uchar*)0x42)) #define VL (*((uchar*)0x43)) #define colorH (*((uchar*)0x44)) #define colorL (*((uchar*)0x45)) |
|
|
|
|
|
|
|
asd21338 发表于 2015-11-23 14:39 |
|
|
|
VH是常量,而程序中当变量用了
|
|
|
|
如VH=colorh
|
|
|
|
你先弄懂宏的定义再编程
|
|
|
|
定义的是常量,在程序中当做变量来用了
|
|
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
758 浏览 0 评论
Protues中自己封装的芯片元件无Program File、Clock Frequency选项怎么解决,求求大神了!
2080 浏览 1 评论
基于51单片机的车辆倒车雷达报警系统,HC-SR04超声波测距,全套资料
942 浏览 0 评论
【原创】收藏!单片机输出4种波形的函数信号发生器毕设(Proteus仿真+原理图+源码和论文)
4164 浏览 1 评论
11793 浏览 6 评论
浏览过的版块 |
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-8-6 21:21 , Processed in 0.776816 second(s), Total 92, Slave 74 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191