简体   繁体   English

什么是与电子元件(步进电机等)接口的良好编程语言(或一组 C++ 库)?

[英]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:我的朋友正在寻找一种能够让他:

  1. Interface with hardware (via serial and USB ports).与硬件接口(通过串行和 USB 端口)。
  2. Write multithreaded code.编写多线程代码。
  3. Throw together UIs very quickly.非常快速地将 UI 组合在一起。
  4. Port his code to Linux and OS X as easily as possible (okay, this is what I want).尽可能轻松地将他的代码移植到 Linux 和 OS X(好吧,这就是想要的)。

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):编辑 - 找到它(有点难找):

http://shoooes.net/ http://shoooes.net/

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.

相关问题 继承Java集合接口(Set,Map,List等)的C ++等价物是什么? 或者扩展AbstractCollection? - What is the C++ equivalent of inheriting a Java collection interface (Set, Map, List etc.)? Or extending AbstractCollection? C ++中'和','或'等关键字的目的是什么? - What is the purpose of the 'and', 'or', etc. keywords in C++? 如何在C ++ mongodb驱动程序中使用$ set,$ inc等 - how to use $set, $inc etc. in c++ mongodb driver C ++套接字编程,带压缩的多播,任何好的库/包装器? - C++ socket programming, multicast with compression, any good libraries/wrappers? 什么是C#中C ++向量的良好替代品? - What would be a good replacement for C++ vector in C#? C 和 C++ 标准库是用什么语言编写的? - What language are the C and C++ standard libraries written in? C++:关键字类 A 有什么作用? B级; class C;等文件开头完成? - C++: What does having keyword class A; class B; class C;, etc. at the beginning of a file accomplish? “modf()”(来自 C/C++ 等的数学 function 等)的简写是什么? - what is “modf()” (a math function from C/C++ etc.) shorthand for? c++ 什么是从文本文件中读取的好方法? - c++ what would be a good way to read from text file? 面向方面的语言是C ++程序员入门的好地方 - What aspect oriented language is a good place to start for a c++ programmer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM