完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
当我听到PSoC 4和板与ARDUIO SHILDS兼容时,我想知道如何将AdUINO库的C++文件移植到PSoC Creator。我能在C++中编写任何代码吗?有可能吗?
如果我要编译PSoC Creator中的C++文件,我如何更改那个库的物理层。 以上来自于百度翻译 以下为原文 When I heard about PSoC 4 and the board being compatible with Arduino shields, I was wondering how I can port al the C++ files of arduino library to be ported to PSoC Creator. Can I write any code in C++. Is it possible? If at all if I were to compile C++ files in PSoC Creator, how do I change the physical layer of that library. |
|
相关推荐
2个回答
|
|
你好,本文介绍了在PSoC使用C++的方法,对你有帮助。HTTP://www. pSOCGooReR.COM/FUMRS/VIEW?PHP?f=43和t=8086,无论如何,即使这样,也存在一些问题,因为PSoC正在使用C语言编写的用户模块的代码。有人想使用C++来为用户模块添加包装软件。你这样做吗?
以上来自于百度翻译 以下为原文 Hi, This article introduce the way to use c++ in PSoC, Might help for you. http://www.psocdeveloper.com/forums/viewtopic.php?f=43&t=8086 Anyway, Even in this way has some problems, because PSoC is using user module's code wrote by C. Someone want to use c++ who have to add wrapping software for the user modules. Do you do that? |
|
|
|
我用C++编写PSoC代码,并编写了一个关于如何做到这一点的小教程。
让PSoC Creator编译C++是第一步,你仍然需要做一些事情,比如转换非标准数据类型和端口任何代码,访问硬件外围设备,系统特性(PSoC和ATmega是不同的)。 如果你想去C,那么谷歌把ARDUINO代码移植到C上,这里有很多资源,如果他们没有去PSoC,那么大部分都是相同的,这要归功于C(和C++)代码的移植性。但是,如果你这样做,你会失去所有你可以用ARDUNO做的好东西,比如, 液晶液晶显示器(12, 13,…) LCD。写(“你好”)。 当然,你可以在C中创建结构,它模仿C++中的类,但是你必须将结构传递给成员函数,并将函数与结构相关联(以C++中的成员函数来模拟),这意味着必须使用函数指针和相应的函数。调用它们的指针。换句话说,不太好,我认为最好先尝试C++方式,然后如果需要的话,再回到C。 以上来自于百度翻译 以下为原文 I write PSoC code with C++, and have written a small tutorial about how to do it here...http://cladlab.com/programming/microcontrollers/psoc/using-cplusplus-with-psoc-creator. Getting PSoC Creator to compile C++ is the first step, you will still have to do things like convert non-standard data types and port any code the accesses hardware peripherals, system features (the PSoC and ATmega are different). If you want to go to C, then Google porting Arduino code to C, there are many resources on this, and it doesn't matter if they were not doing it to go to a PSoC, most of it will be same, thanks to the portability to C (and C++) code. However, if you do this, you will loose all the nice stuff you could do with the Arduino, like for example, LiquidCrystal lcd(12, 13, ..) lcd.write("Hello"). You can of course create structures in C which emulate the classes in C++, but you will have to pass in the structure to the member functions, and associating functions with the structures (to emulate member functions in C++), will mean having to use function pointers and consequentially functions pointers to call them. In other words, not nice, and I reckon it's better to try the C++ way first, and then fall back to C if you have to. |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2070 浏览 1 评论
1826 浏览 1 评论
3639 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1761 浏览 6 评论
1513 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
511浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
361浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
410浏览 2评论
357浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
857浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 13:13 , Processed in 1.062074 second(s), Total 80, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号