Hi there, I don't have a program to offer you. All my old code is in other languages. I did however write a little working example for you. You will need to use port, not parport0. For some reason that is unknown to me, I too, am unable to get parport to work correctly from gambas.
I tested the code below, and it does work. I ran it a few times on a system with Ubuntu 9.04, gambas 2.20, and a little parallel port tester I made 20 years ago. Unless you have already sorted out permission to access 'port', you will need to be root to run it, either start gambas as root, or compile it and then run the executable as root. PUBLIC SUB Main() ' Gambas module file DIM pport AS File DIM bi, bo AS Byte pport = OPEN "/dev/port" FOR READ WRITE FOR bo = 32 TO 122 SEEK #pport, 888 WRITE #pport, bo SEEK #pport, 888 READ #pport, bi PRINT Chr(bi) & " " WAIT 0.05 NEXT CLOSE #pport END Just a quick mention about seek on ports. Seek simply takes you to the port address. Notice I used a seek before each read or write. 888 (0x378): Data 889 (0x379): Status 890 0x37A) : Control Hope this helps Regards Les Hardy Bjorn Macintosh wrote: > Hi all, > > Does anyone have a program that interfaces with the parallel port, one > written in Gambas. If you do would you be willing to share this program > with me as I am trying to write a parallel port interface and am struggling > to get my head around a few concepts. mainly how to write to the port and > how to select pin's base 0 base1 and base2. > > Any help would be greatly appreciated. I sent a post two days ago holding > the full details on my program and what I am trying to do if you need any > clarification. > > Thanks > Bjorn Macintosh > > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user