Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Accessing paralel port (http://www.chiefdelphi.com/forums/showthread.php?t=39073)

[527]phil 24-07-2005 21:01

Accessing paralel port
 
Ok so I started on a small robot that i'm going to control using an old toshiba satalite laptop. I know how to use the parallel port to hook it up. I'm trying to program it in BASIC but i don't know how to send information through the parallel port. What I DO know is that i have to send data bits, eight in total. If I send a 0 it will trigger something off, if I send a 1 it will trigger it on. But how do I send data through a particular port using BASIC language?

Timothy D. Ginn 24-07-2005 22:46

Re: Accessing paralel port
 
Quote:

Originally Posted by [527]phil
Ok so I started on a small robot that i'm going to control using an old toshiba satalite laptop. I know how to use the parallel port to hook it up. I'm trying to program it in BASIC but i don't know how to send information through the parallel port. What I DO know is that i have to send data bits, eight in total. If I send a 0 it will trigger something off, if I send a 1 it will trigger it on. But how do I send data through a particular port using BASIC language?

See: http://ourworld.compuserve.com/homep...wden/page6.htm (it's got some QBASIC code for reading from the parallel port, and does have some mention of using the OUT command for sending data rather than the INP command for reading it.

Tristan Lall 25-07-2005 00:38

Re: Accessing paralel port
 
What's the operating system of the laptop? In DOS-based operating systems (e.g. MS-DOS 6.22, Windows 95, Windows Me) you can access the parallel port directly using the language's I/O port routines (I know, for example, that Pascal allows you to write to Port[$387] for LPT1, or to run inline assembly routines). With Windows NT-based operating systems (e.g. Windows NT 4.0, Windows 2000, Windows XP), you need to use some driver that provides the appropriate access routines—it's more difficult, but also more robust. If it's not Windows or DOS, I wouldn't know.

Try this for some information on parallel ports under a DOS-based system (in Pascal, but easy to understand).

[527]phil 25-07-2005 07:56

Re: Accessing paralel port
 
The laptop is running windows 98 SE. But the first page helped and right now I have 6 LED's chasing each other when I let go of a micro switch.

Joe Johnson 25-07-2005 08:01

Re: Accessing paralel port
 
This Kit from kitsrus.com (available here) uses the parallel port on a PC as a cheap "Data Acquistion"

The interesting bit for the purposes of this thread is that this document has a discussion of IO via the printer port (addresses, which pins do what, how to read from the port, how to write to it, etc.) . It has BASIC code examples (though they are specific to the particular IO box, if you know a bit about the chips used on the board, you can pretty much follow what is going on).

Good luck.

Joe J.


All times are GMT -5. The time now is 04:37.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi