C语言 如何使用C语言编写LEGO Mindstorms EV3?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28526200/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to program LEGO Mindstorms EV3 using C language?
提问by David Lechner
First of all, I'm new for this and I need a little help!
首先,我是新手,我需要一点帮助!
I have a LEGO Mindstorms EV3 robot, I downloaded (LEGO Mindstorms EV3 Home Edition) to control the EV3. Unfortunately, I couldn't find the source code for the EV3 in the mentioned software. So, please if anybody could tell me the name of the software that enables you to program EV3! I would be most appreciated!
我有一个 LEGO Mindstorms EV3 机器人,我下载了(LEGO Mindstorms EV3 Home Edition)来控制 EV3。不幸的是,我在上述软件中找不到 EV3 的源代码。所以,如果有人能告诉我可以让您对 EV3 进行编程的软件的名称!我将不胜感激!
I also downloaded (Bricxcc) software but it was an old version. I couldn't find a newer version which contains EV3.
我也下载了 (Bricxcc) 软件,但它是旧版本。我找不到包含 EV3 的更新版本。
Can I use C language to program EV3 ? Or to add some features to the sensors?
我可以使用 C 语言编写 EV3 吗?或者为传感器添加一些功能?
Note: I ended with leJOS software to program the code with java it is much easier and there are a lot of resources for the EV3 brick in java. Wish you all the best!
注意:我用 leJOS 软件结束,用 java 编写代码它更容易,而且有很多资源用于 java 中的 EV3 砖。祝你一切顺利!
回答by David Lechner
You can find the EV3 source code here: https://github.com/mindboards/ev3sources
您可以在此处找到 EV3 源代码:https: //github.com/mindboards/ev3sources
The generated documentation from this source code is available hereand here.
Bricxcc has some experimental support for EV3 but it is not being actively developed (since Oct. 2013). You can find the latest test version here. Searching the web for "bricxcc ev3" will come up with some tutorials (for example, the one at http://www.robotnav.comlooks good).
Bricxcc 对 EV3 有一些实验性支持,但它没有得到积极开发(自 2013 年 10 月以来)。您可以在此处找到最新的测试版本。在网上搜索“bricxcc ev3”会找到一些教程(例如,http://www.robotnav.com 上的教程看起来不错)。
ROBOTCis a good alternative, although it is not free.
ROBOTC是一个不错的选择,虽然它不是免费的。
There is also ev3dev. There is a C library for ev3dev hereor you can write your own.
回答by a3f
The EV3 runs on Linux w/ glibc, so you only need to upload your C programs. For C++ you need to copy over the C++ standard library. Programming like that is a bit inconvenient, as you have to mess directly with the device files.
EV3 在带有 glibc 的 Linux 上运行,因此您只需要上传您的 C 程序。对于 C++,您需要复制 C++ 标准库。这样的编程有点不方便,因为您必须直接弄乱设备文件。
The c4ev3bundle streamlines this. It's built around an Eclipse Plugin that includes a GCC Toolchain, an API and an integrated Uploader and File browser usable right out of Eclipse.
该c4ev3束简化这一点。它围绕一个 Eclipse 插件构建,该插件包括一个 GCC 工具链、一个 API 和一个可以直接在 Eclipse 之外使用的集成上传器和文件浏览器。
C and C++ Hello World template projects are included. API and Uploader are also usable separately from Eclipse, so you can use it however you like.
包括 C 和 C++ Hello World 模板项目。API 和 Uploader 也可与 Eclipse 分开使用,因此您可以随心所欲地使用它。
Check it out :-)
一探究竟 :-)
Disclosure: I wrote part of the software.
披露:我编写了部分软件。

