[英]What would be a good programming language (or a set of libraries for C++) to interface with electronic components (stepper motors etc.)?
I'm not an electronics guy, so I might not be able to explain precisely what I need.我不是电子专家,所以我可能无法准确解释我需要什么。 This is a question a friend keeps asking me.
这是一个朋友一直问我的问题。
What my friend is looking for is a programming language that would allow him to:我的朋友正在寻找一种能够让他:
He is building a tool for a local group that teaches very basic robotics to college students.他正在为一个向大学生教授非常基本的机器人技术的当地团体构建一个工具。 Right now he's using C++, but writing the UI code in C++ is not exactly a fun task.
现在他正在使用 C++,但是在 C++ 中编写 UI 代码并不是一个有趣的任务。 He is also using some Windows-specific libraries for (1), which means I can neither try out his code nor help him with fixing bugs (I use a Mac).
他还为 (1) 使用了一些特定于 Windows 的库,这意味着我既不能试用他的代码,也不能帮助他修复错误(我使用的是 Mac)。
EDIT: Libraries for Python/Ruby are welcome.编辑:欢迎使用 Python/Ruby 库。
You may want to have a look at the rather complementary Processing and Wiring tools.您可能想看看相当互补的处理和接线工具。 Processing is an environment for building user interfaces, and Wiring is an environment for programming I/O boards such as the eponymous Wiring board, its simpler cousin Arduino , and related devices.
处理是构建用户界面的环境,布线是编程 I/O 板的环境,例如同名的布线板、其更简单的表亲Arduino和相关设备。 The Wiring boards typically communicate with a desktop computer over a serial link, or USB with serial emulation.
接线板通常通过串行链路与台式计算机通信,或通过串行仿真与 USB 通信。
Java might be a good option here. Java 在这里可能是一个不错的选择。 It has libraries available for the low-level threading and communication APIs, and it should perform well enough for a control loop.
它具有可用于低级线程和通信 API 的库,并且对于控制循环应该足够好。 I know it has a serial port communcations library, and I believe there are some open-source USB libraries.
我知道它有一个串口通信库,我相信有一些开源的 USB 库。 For the UI, you could use the Java 2D Graphics API, or for a more advanced UI you could try the slightly neglected Java3D or newer JOGL libraries.
对于 UI,您可以使用 Java 2D 图形 API,或者对于更高级的 UI,您可以尝试稍微被忽略的 Java3D 或更新的 JOGL 库。 Swing has its faults, but it's actually pretty easy to use for making basic forms UIs.
Swing 有其缺点,但它实际上很容易用于制作基本的 forms UI。
If you want easy and lots of supported hardware I think your best bet is Labview.如果您想要简单且大量受支持的硬件,我认为您最好的选择是 Labview。 It's all graphical programming (drag blocks, make connections) and many USB devices (DIO for instance) have Labview support.
这都是图形编程(拖动块,建立连接),许多 USB 设备(例如 DIO)都支持 Labview。 Serial support is built-in.
串行支持是内置的。 It can make UIs rather easily (it's primarily intended for GUI control).
它可以很容易地制作 UI(它主要用于 GUI 控制)。
Ruby and Shoes (GUI) would work nicely, especially well suited to a learning environment / multiplatform Ruby 和鞋子 (GUI) 可以很好地工作,特别适合学习环境/多平台
Edit - Found it (its a bit hard to find):编辑 - 找到它(有点难找):
ACE ( http://www.cs.wustl.edu/~schmidt/ACE.html ) is a platform independent C++ library (no UI), QT ( http://www.qtsoftware.com/products/ ) is a cross platform UI library for C++. ACE ( http://www.cs.wustl.edu/~schmidt/ACE.html ) is a platform independent C++ library (no UI), QT ( http://www.qtsoftware.com/products/ ) is a cross C++ 的平台 UI 库。 Accessing hardware is unfortunately something that is still platform dependent)
不幸的是,访问硬件仍然依赖于平台)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.