You should start a separate thread for a different question. Getting input from an external device will depend entirely upon your system implementation and its operating system. Access to various ports is not as readily available from desktop systems as it once was (that's a protective benefit). However, each system will probably provide some methods for serial and parallel port I/O. Again, they will vary depending upon what you have.