完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
我在MPLAB中用PX18F45 25i编写的XC8编写了下面的代码,我不把它加载到芯片上,只是试图在模拟器下运行它,看看它是否会因为我不需要使用这个芯片,这个问题是说主本身是未知的,我确信我是M。IsBasic基本是我甚至不能开始思考的。头文件:源代码,这里是主文件,所有错误都在邮件文件中。
以上来自于百度翻译 以下为原文 I am programming in MPLab with XC8 for PIC18F4525 I have written the following code and I am not loading it on to the chip, just trying to run it under simulator and see if it would as I am not required to use the chip for this The issue is saying that the main itself is unidentified, I am sure I am missing something basic that I cannot even begin to think about. Header file : /** * * This is the header file * written by Avni Salhotra * */ // prototype of the functions in calculate volume float volumeSphere(float radiusOfSphere); float volumeCylinder(float radiusOfCyclinder,float heightOfCyclinder); float volumeEllipsoid(float valueAlongAxis1,float valueAlongAxis2, float valueAlongAxis3); Source code #include # define _PI_ 4.0*ATAN(1.0) float volumeSphere(float radiusOfSphere) { return (4 * _PI_ * radiusOfSphere * radiusOfSphere * radiusOfSphere)/3; } float volumeCylinder(float radius,float height) { return _PI_ * radius * radius * height; } float volumeEllipsoid(float valueAlongAxis1,float valueAlongAxis2,float valueAlongAxis3) { return (4 * _PI_ *valueAlongAxis1 * valueAlongAxis2 * valueAlongAxis3)/3; } Now here is the main file all the errors are in mail file #include #include #include "calculateVolume.h" int main(void) { float radiusOfSphere,radiusOfCyclinder,heightOfCyclinder,valueAlongAxis1,valueAlongAxis2,valueAlongAxis3; printf("nCalculate Volume of spheren"); printf("Enter radius: "); scanf("%f",&radiusOfSphere); printf("Volums of Sphere is %f", volumeSphere(radiusOfCyclinder)); printf("nCalculate Volume of Cyclindern"); printf("Enter radius: "); scanf("%f",&radiusOfCyclinder); printf("Enter height: "); scanf("%f",&heightOfCyclinder); printf("Volums of Sphere is %f", volumeCylinder(radiusOfSpehere,heightOfSphere)); printf("nCalculate Volume of Ellipsoidn"); printf("Enter side of value along axis 1: "); scanf("%f",&valueAlongAxis1); printf("Enter side of value along axis 2: "); scanf("%f",&valueAlongAxis2); printf("Enter side of value along axis 3: "); scanf("%f",&valueAlongAxis3); printf("Volume of the ellipsoid is %f", volumeEllipsoid(valueAlongAxis1,valueAlongAxis2,valueAlongAxis3)); return 0; } |
|
相关推荐
3个回答
|
|
|
|
|
|
|
|
|
那是什么?主(空)应排除主(空)
以上来自于百度翻译 以下为原文 and what was it? int main(void) should be void main(void) |
|
|
|
|
|
因此,XC8不再支持ScffFAMILY。这是在创建一个只为模拟和输入键盘输入的代码时想到的。
以上来自于百度翻译 以下为原文 so it turns out xc8 no longer supports the scanf family.. which is what comes to mind when creating a code just for simulating and taking keyboard input |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501 浏览 0 评论
5808 浏览 9 评论
2350 浏览 8 评论
2237 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3543 浏览 3 评论
1155浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1119浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
887浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-12 05:27 , Processed in 0.573519 second(s), Total 82, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1567