完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我想写一个简单的LED电压表程序,并可以真正使用一些帮助。最初我有很多PLIB错误,但是我安装了外围库,这似乎解决了这个问题。但是,现在我遇到几个关于“目标食谱”的错误。我在论坛上搜索了好几天了,似乎无法修复它,所以非常感谢您的帮助。我使用的是MPLAB X IDE v3.35、XC8 v1.38和Linux Ubuntu。以下是我的代码:这里是收到的错误:make-f nbproject/Makefile-default.mk SUBPROJECTS=.build-confmake[1]:输入目录'/home/steve/MPLABXProjects/tester.X'make-f nbproject/Makefile-default.mk dist/default/./tester.X.hexmake[2]:输入目录'/home/steve/MPLABXProjects/tester.X'"/opt/microhip/xc8/v1.38/bin/xc8"--pAs1--.=18F45K22-Q-G--double=24--float=24--emi=wordwrite--opt=default,+asm,+asm file,-.,+space,-debug--addrqual=.e--mode=free-P-N255--warn=-3--asmlist-DXPRJ_default=default--.y=default--.y=default,-psect,-class,+mem,-hex,-file--output=default,+inhx032--runtime=default,+.,+in它,-保持,-no_启动,-下载,+config,+clib,-plib--output=-mcof,+clib,-plib--output=-mcof=-mcof,+elf:multiloc--stack=output=-elf=output=-mcof:mcof:mcof:auto:auto:auto:auto:auto:auto,+elf:auto:multiloc:multiloc--stack:multiloc:multiloc--stack=编译=编译:auto:auto:auto:auto:auto:auto:auto:auto"--err格式"--err格式=%f:%f:%f:%1%1%1%1 1 1:%1%1%1 1错误:(195)表达式syntaxtester.c:42:error:“)”expectedtester.c:44:warning:(345)不可达codetester.c:44:warning:(361)函数声明为隐式inttester.c:44:error:(195)expression syntaxtester.c:46:error:(194)”expectedtester.c:46:error:(195)expression syntaxtester.c:48:error(194)“)”expectedtester.c:50:error:(313)函数体expectdtester.c:51:error:(285)声明测试器中没有标识符。pectedtester.c:55:error:(285).iontester.c:55中没有标识符:warning:(374)缺少基本类型;int.edtester.c:55:error:(314);“expectedtester.c:56:error:(194)”)“expectedtester.c:58:error:(313)函数体expectedtester.c:59:error:(285)声明中没有标识符ster.c:59:warning:(374)缺少基本类型;int.edtester.c:59:error:(314);“expectedtester.c:60:error:(194)”)“expectedtester.c:60:warning:(371)缺少基本类型;int.edtester.c:60:error:(984)type redeclaredtester.c:60:error:(1098)变量的冲突声明_.”(tester.c:60)(908)退出状态=1nbproject/Makefile-default.mk:100:目标“build/default/./tester.p1”failedmake的配方[2]:离开目录“/home/steve/MPLABXProjects/tester.X'nbproject/Makefile-default.mk:84:目标“.build-conf”failedmake的配方[1]:离开导演y'/home/steve/MPLABXProjects/tester.X'nbproject/Makefile-impl.mk:39:target'.build-impl'failedmake[2]的配方:***[build/default/./tester.p1]Error 1make[1]:***[.build-conf]Error 2make:***[.build-impl]Error 2BUILD FAILED(出口值2,总时间:460ms)感激。我一直在看MaX文件,但是我对它很陌生,所以我真的不知道我在寻找什么。
以上来自于百度翻译 以下为原文 Hi, I'm trying to write a simple LED Voltmeter program and could really use some help. Originally I was getting lots of plib errors, but I then installed the peripheral libraries, which seemed to resolve the issue. However, I'm now getting several errors referring to 'Recipe for target'. I've been searching the forums for days and can't seem to fix it, so any help would be much appreciated. I'm using MPLAB X IDE v3.35, XC8 v1.38 and Linux Ubuntu. Here is my code: #include #include #pragma config MCLRE = EXTMCLR, WDTEN = OFF, FOSC = HSHP #define _XTAL_FREQ 8000000 #define LED01V PORTDbits.RD0 #define LED12V PORTDbits.RD1 #define LED23V PORTDbits.RD2 #define LED34V PORTDbits.RD3 #define LED45V PORTDbits.RD4 void main() { unsigned long Vin, mV; ANSELD = 0; ANSELA = 1; TRISD = 0; TRISA = 1; OpenADC(ADC_FOSC_2 & ADC_RIGHT_JUST & ADC_12_TAD, ADC_CH0 & ADC_INT_OFF, ADC_TRIG_CTMU & ADC_REF_VDD_VDD & ADC_REF_VDD_VSS); for(;;) { PORTD = 0; SelChanConvADC(ADC_CH0); while(BusyADC()); Vin = ReadADC(); mV = (Vin * 5000)>>10; if(mV <==1000) { LED01V = 1; } elseif(mV>1000 && mV <==2000) { LED12V = 1; } elseif(mV>2000 && mV <==3000) { LED23V = 1; } elseif(mV>3000 && mV <==4000) { LED34V = 1; } elseif(mV>4000 && mV <==5000) { LED45V = 1; } __delay_ms(10); } } Here are the errors I'm receiving: make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf Any help would be much appreciated. I've been looking in the Makefile, but I'm new to this so I don't really know what I'm looking for. Cheers Steve |
|
相关推荐
7个回答
|
|
在你的if语句中去掉l&=========?
以上来自于百度翻译 以下为原文 get rid of the <== in your IF statements, they should be <= |
|
|
|
在处理错误消息时,总是从第一个开始,而不是最后一个。
以上来自于百度翻译 以下为原文 When dealing with error messages, always start with the FIRST one, not the LAST one. |
|
|
|
|
|
|
|
…把所有多余的东西都扔掉。
以上来自于百度翻译 以下为原文 ... and get rid of all those mV>X000 && as they are redundant. |
|
|
|
非常感谢你们的帮助,我真的很感激。我已经做了你们的建议。我也意识到我在“else if”之间没有空格。但是,我仍然收到错误消息,尽管少了很多。下面是我现在所犯的错误:有什么想法吗?
以上来自于百度翻译 以下为原文 Thanks a lot for the help guys, I really appreciate it. I've made the changes you advised. I also realised I didn't have a space between the 'else if'. However, I'm still receiving error messages, albeit a lot less. Here are the errors I'm getting now: Any ideas? |
|
|
|
它看起来像一个PLIB功能。你安装了吗?在编译器选项中检查外围设备库吗?
以上来自于百度翻译 以下为原文 _ReadADC that looks like a PLib function. Did you install it? Did you check use Peripheral libraries in the compiler options? |
|
|
|
干杯,NKurzman。现在开始工作了。非常感谢帮助的家伙。咧嘴笑:
以上来自于百度翻译 以下为原文 Cheers, NKurzman. It's working now. Really appreciated the help guys. grin: |
|
|
|
只有小组成员才能发言,加入小组>>
5250 浏览 9 评论
2037 浏览 8 评论
1958 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3218 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2266 浏览 5 评论
788浏览 1评论
680浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
609浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
685浏览 0评论
582浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-29 01:15 , Processed in 1.600128 second(s), Total 89, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号