• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 669
  • Last Modified:

Programming to Control External Devices

Hello Everyone,

Let's say I had an external device that connects to a workstation via USB/Serial/whatever.  In this example, let's make the device a "mouse-like" device but instead of the user moving the mouse,  n application would tell the mouse to move left/right/up/down (assuming that this device had that ability).

What is the most common programming language used to interface with an external device such as the one described?  Is there a general term for this kind of application development?   Is there any good links where I can get some of the basic information on how this is accomplished?

As always, thanks everyone.  Iove this site.

Chris, Baltimore
4 Solutions
I think the device you're talking about has a microprocessor? In this case the therm for that you like to do is embedded systems. You have to download a development enviroment like keil (http://www.keil.com/demo/ the demo is enough for developing small applikations). You'll develop in C or Assembler if you prefer!

If you don't want to programm the microprocessor on the device first of all you have to know how to "talk" with the device. There're several ways to communicate with an external device in C#, Java or C++

best regards
normally if you have a usb, serial device if have already a protocoll, how to communicate with the device, Normmaly there are several ways of these bus: usb, serial, ieee1394, can-bus, etc. for programming roboters it was can-bus the most used. For webcams it was usb, and for camcoders and ipods it is firewire (ieee1394). The controling program language is irrelevant, the program most just know what to write and how to read from the bus. So every program language which support your operational system should work. you just must be sure it is fast enough (thats is why c and assembler are normally used).
Java is also used for mobile phones cause java can be ported easily for different environments without big trouble. So it depends on what exact configuration you have, generally i would recommand or c or java, since they are the most comman and easy to learn.
clebo99Author Commented:
Wow....Thanks for the quick responses.....So, for a person like myself who is "somewhat good" at VB6/.Net2003, what's the best way to learn this? What "category" of book would I look for on say Amazon or at Barnes and Noble?

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

well if you use usb, you dont need a book, since you can read for a file, you must have a little understanding of protocols and exchange of information with protocols (tcp/ip for example). with serial, you must read and interpret the read data and write to the device file (i think there is enough tutorials on web). For usb there is also tutorials.
for visual basic, mostly it depends on the protocol for exchange, that is the main constrain.
Here a book about usb (i didnt read, but sounds good)
USB Complete: Everything You Need to Develop Custom USB Peripherals
most of these information you can find on the web, so search twice before you buy a book.
If you're considering making this hardware yourself you may wish to consider a very popular microcontroller called the PIC Microcontroller by Microchip. Somewhere like Maplins sells a very good starter kit to get you up and running called the PIC Flash Starter Kit. There is reading material available which will help you get started such as 101 PIC Microcontroller Experiments For The Evil Genius (Available from Amazon) which I have personally worked through and I can tell you it's a very nice and gentle introduction to working with this processor.

You can use the PIC to drive your motors and automate stuff. The Flash starter kit has all the hardware you need to get up and running with this including a little experimenter board so you can solder on components and test your circuits.

Some background knowledge in electronics might be useful too!

You may also find Serial Port Complete and Parallel Port Complete to be useful books because they will teach you some of the fundamentals of talking to hardware with low level API's. Also look at Programming the Windows Driver Model which will teach you some of the fundamentals of writing device drivers which are a (sometimes) more convenient method of controlling hardware.
Hardware should be supplyed with some software, if you are to buy this "mouse" from somone else. A well documented library-interface to talk to the hardware must be given, for example a DLL file. You can link a dll to your VBasic application can't you?
Going into PIC's, assamblers, embeded systems, PCB design is totaly separet bruch of technology. If you are a software  you may end up at the university to master electronics :-)  Or at least spend 6 monts learning -- depend how deep you want to go with that project.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now