can someone tell me how to access the parallel port in c++ using linux operating system. I had some codes I used , it sent and was able to read data at the data register. but unfortunately when i connected some leds to the parallel port, i noticed that the was no effect on the ports, because the leds did not change.please can someone help.
You can access the io ports if you run the program with root privilidges.
I actually used 'root' to login thats whats even making me more confused. I dont know if there is something like a parallel port driver i have to install before it works. I experienced a similar thing once on windows. A program that was able to access the parallel port in win 98, and changed the LED display was unable to do same in win XP. I really need help.
I am doing remote temperature data collecting system which about 400km away from my office. But it's a visual basic programs which use parallel port to acquire the temperature data. My program has been integrated with a trial activex control from www.geocities.com/bagtool/adc_activex.html
I think this adc activex control provides a good result. I hope it will help.
Windows above 98 or linux there is no control of the ports for user. In kernel mode it is available.
In NT/2K/XP we have to use "inpout32.dll" or "io.dll" which can be downloaded from internet.
In linux, you must log in as "root", and in the C program you need to do the follwing.
1) include <asm/io.h>
2) you have to use the option with −O1 or higher, I have tried -O2 and it worked
3) before accessing the ports, you must seek the permissions for the ports with which you want to access.
This is done with "ioperm" function call.
for parport ioperm(0x378, 3, 1)
4) Then only you will get true access to the ports.