Thank you so much in advance.How can i control a simple motor, or some LEDs via USB using C or C++?
First, understand you are talking about communication with a hardware device. And that kind of programming is generally very tricky, but not impossible, of course.
You'll need the instruction set for operating the device, generally proprietary but sometimes in the public domain. Before MS windows caught on, we used to have to write specific video/graphic card code for all the main brands to ensure most users could enjoy our graphic software. It was a bear, and took a lot of time. Then a new brand of video card would appear, and...well, it took a lot of energy and development time away from the main program, but it was do-able.
But anyway, we'd often write to manufacturers (before the VESA standard) for this proprietary card-controlling instruction set. Later, card manufacturers provided this info directly to microsoft upon creation, and that helped ensure success of the MS Windows environment and the card/hardware manufacturer. It was profitable for both, but took driver developement out of the hands of the garden variety of programmers. Many programmers welcomed the release from the hassles of writing directly to the metal. Eventually I did too, but I miss it sometimes.
Sorry all the story telling! Point is: 1.) you need to know not only how to write to the USB (or whichever) port, but you need the instruction set to operate the device as well, which is often hard, but not impossible, to get. And 2.) this is the more challenging sort of programming. If you don't get it, it certainly doesn't mean you're stupid. OK?
Here's a site or 2 to help you get started...How can i control a simple motor, or some LEDs via USB using C or C++?
It is not that easy. Consider contacting a freelance programmer at websites like http://getafreelnacer.com/
You can easily control them through the parallel ports.These parallel ports has a port number,it has totally 25 pins.You can easily get the manuals of them.go to links like http://www.codeproject.com/vbscript/Stepper_Motor_Control.asp and http://www.logix4u.net/parallelport1.htm.
Thus knowing the purpose of each pin by their configuration,you can control them
No comments:
Post a Comment