我需要学习什么才能编写一个通过 USB 将数据发送到预编程微控制器的程序?
了解我的编程经验只能追溯到几个月前,我不确定如何表达这个问题,但请耐心等待。我对任何批评持开放态度,并且很乐意用您要求的任何细节更新我的问题,但无论如何......我的问题是,是否有我应该研究的某个 API,或者我应该用来创建的某个编译器一个可以通过 USB 链路向另一端的微控制器发送几个字节的程序?程序如何识别将信息发送到哪个端口?谢谢。如果需要的话,我很乐意重新表述这个问题。
Understanding that my programming experience only stretches back a few months, i'm unsure how to phrase this question, but bear with me. I'm open to any criticism and will gladly update my question with whatever details you ask for, but anyways.... My question is, is there a certain API that I should look into, or a certain compiler I should use to create a program that would send a few bytes over a usb link to a micro-controller on the other end? How would the program identify which port to sent the information to? Thanks. I'd be glad to rephrase this question if need be.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
仅使用 USB 转串口转换器可能会容易得多;通过 USB 串行端口发送几个字节在两端都会容易得多。 Arduino 或 TI MSP430 launchpad(售价高达 4.30 美元)板载 USB 转串行设备,因此几乎是透明的,并且读取传入数据并发送回数据将变得几乎愚蠢容易,并且会有大量大量教程告诉没有经验的人如何做到这一点,例如这个适用于 Arduino。
It might be substantially easier to just use a USB-to-serial converter; sending a few bytes over a USB serial port is going to be a lot easier on both ends. Devices like the Arduino or the TI MSP430 launchpad (for a whopping $4.30) have USB-to-serial devices onboard so it's almost transparent, and reading the incoming data and sending back data is going to be almost stupid easy and there will be a boatload of tutorials on how to do it for the inexperienced, like this one for the Arduino.
有 pyusb,它是可移植的并且用 Python 编写,是一个简单的语言来拾取。它是一个 C 库 libusb 的包装器。还有 Perl、Lua、Java 和 Ruby(等)的包装器。
There's pyusb, which is portable and written in Python, an easy language to pick up. It's a wrapper around libusb, a C library. There are also Perl and Lua and Java and Ruby (etc.) wrappers for it.