What do I need to learn to write a program that will send data to a preprogrammed microcontroller through 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 informati开发者_StackOverflow社区on to? Thanks. I'd be glad to rephrase this question if need be.
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.
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.
精彩评论