完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我收到了几个警告:(520)函数“……”从来没有被称为错误。下面是我的代码。谁能告诉我哪里出了问题?这里是我收到的错误:::warning:(1273)Free modeLCDVoltmeter.c:23:warning:(520)function“_DelayFor18TCY”从不被调用LCDVoltmeter.c:33:warning:(520)function“_DelayPORXLCD”从不被调用LCDVoltmeter.c:39:warning:(520)function“_DelayFor18TCY”。“ayXLCD”从未被称作:0:错误:(500)未定义的符号:_SetDDRamAddr(dist/default/./LCDVoltmeter.X...obj)_WriteCmdXLCD(dist/default/./LCDVoltmeter.X...obj)_ReadADC(dist/default/./LCDVoltmeter.X...obj)_OpenADC(dist/default/./LCDVololPUTYADC(DIST/Deal/Deult/LCDValMig.x.Outual.Objo)PUTRSXLCD(DIST/Deal/Deult/LCDValMex.x.Outual.Obj.x).XXLCD(DIST/Deult/Deult/LCDValMex.x.Outual.Obj.)BuxYLCD(DIST/Deal/Studio/LCDValMex.x.Deal.Obj.PoxxLCD)(DIST)/默认/生产/ LCDValt.xOut.Obj.O.SelChhanValdC(DIST/Deult/Deult/LCDValMex.x.Sudio.Obj.)(908)退出状态=1nbPosi/MaFaCuff.DEFA.MK:125:目标“DIST/Deule/Deule/LCDValMex.x.Engult.HEX”FultDead [2 ]的配方:离开目录'/home /史提夫/mPLABXProjects/LCDVoltmeter.X'nbproject/Makefile-default.mk:84:target'.build-conf'failedmake的配方[1]:Leaving directory'/home/steve/MPLABXProjects/LCDVoltmeter.X'nbproject/Makefile-impl.mk:39:target'.build-impl'failedmake的配方[2]:***[dist/default/./LCDVoltmeter.X.produc.produc.error 1make[1]: ***[.build-conf]Error 2make: ***[.build-impl]Error 2BUILD FAILED(退出值2,总时间:2s)谢谢。
以上来自于百度翻译 以下为原文 I'm receiving several warning: (520) function ".............." is never called errors. Below is my code. Can anyone tell me where I'm going wrong? #include #include #include #include #include #include #pragma config MCLRE = EXTMCLR, WDTEN = OFF, FOSC = HSHP #define _XTAL_FREQ 8000000 void Delay_Seconds(unsigned char s) { unsigned char i,j; for(j=0;j for(i=0;i<100;i++)__delay_ms(10); } } void DelayFor18TCY(void) { Nop();Nop();Nop();Nop(); Nop();Nop();Nop();Nop(); Nop();Nop();Nop();Nop(); Nop();Nop(); return; } void DelayPORXLCD(void) { __delay_ms(15); return; } void DelayXLCD(void) { __delay_ms(5); return; } void LCD_Clear() { while(BusyXLCD()); WriteCmdXLCD(0x01); } void LCD_Move(unsigned char row, unsigned char column) { char ddaddr = 40*(row - 1)+ column; while(BusyXLCD()); SetDDRamAddr( ddaddr ); } void main() { unsigned long Vin, mV; char op[10]; ANSELB = 0; //Configure port B as digital ANSELA = 1; //Configure port A out analog TRISB = 0; //Configure port b as output TRISA = 1; //Configure port A as input Delay_Seconds(1); OpenXLCD(FOUR_BIT & LINES_5X7); OpenADC(ADC_FOSC_2 & ADC_RIGHT_JUST & ADC_20_TAD, ADC_CH0 & ADC_INT_OFF, ADC_TRIG_CTMU & ADC_REF_VDD_VDD & ADC_REF_VDD_VSS); while(BusyXLCD()); //Wait if LCD is busy WriteCmdXLCD(DON); //Turn display on while(BusyXLCD()); //wAIT IF LCD IS BUSY WriteCmdXLCD(0x06); //Move cursor right putrsXLCD("VOLTMETER"); //Display heading Delay_Seconds(2); LCD_Clear(); for(;;) { LCD_Clear(); SelChanConvADC(ADC_CH0); while(BusyADC()); Vin = ReadADC(); mV = (Vin * 5000)>>10; LCD_Move(1,1); putrsXLCD("mV = "); mV = (Vin * 5000)>>10; itoa(op,mV,10); LCD_Move(1,6); putsXLCD(op); Delay_Seconds(1); } } Here are the errors I receive:
Thank you. |
|
相关推荐
2个回答
|
|
你使用的是XC8编译器的版本?你安装了周边图书馆吗?(它是XC8新版本中的单独下载)。您正在使用库中的函数,所以如果没有安装,就会发生这种情况。还要确保您已经选择在项目属性的编译器选项中使用外围库。
以上来自于百度翻译 以下为原文 What version of XC8 compiler are you using? Do you have the peripheral libraries installed? (it is a separate download in newer versions of XC8). You are using functions from the library so if it is not installed then this is what happens. Also make sure you have selected to use the peripheral libraries in the compiler options of the project properties. |
|
|
|
谢谢您。我忘了在外围图书馆打勾链接。感谢你的帮助。史提夫
以上来自于百度翻译 以下为原文 Thank you. I had forgot to tick 'Link in peripheral libraries'. Appreciate the help. Steve |
|
|
|
只有小组成员才能发言,加入小组>>
5160 浏览 9 评论
1998 浏览 8 评论
1927 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3170 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2225 浏览 5 评论
729浏览 1评论
613浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
503浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
628浏览 0评论
526浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 15:28 , Processed in 1.289288 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号