Click to See Complete Forum and Search --> : Parallel port control/ranting


Cerf
05-17-2004, 11:09 PM
Yo yo yo,

This is probably going to turn into me blowing off some steem, and I am sorry to all you out there, especially those of you who have tried to help me.

But what I am trying to do is, make the parallel port control some leds. its been 2 weeks since I started this 'project' and Ive gone no where. Ive read about it (it didnt look too hard), ive seen demoes, but whatever I do - it doesnt work. even parapin doesnt work for me.

Here is the code I have,


#include <stdio.h>
#include <unistd.h> /* needed for ioperm() */
#include <sys/io.h> /* for outb() and inb() */
#include <iostream.h>

#define DATA 0x378 //lp0
#define STATUS DATA+1
#define CONTROL DATA+2

int main(void)
{
if (ioperm(DATA,3,1)) {

printf("Sorry, you were not able to gain access to the ports\n");
printf("You must be root to run this program\n");

outb(DATA, x); /* Sends 0011 0010 to the Data Port */
return 0; /*make pin 0 LO, pin 2 LO, pin 3 & 4 HI, ... */
}



Does anyone have an suggestions, a code example would be very helpful.

Thankyou (sorry for the rant)

bwkaz
05-18-2004, 06:15 PM
Please do not double (or in this case, close to triple) post. One post per problem is more than enough.

I am sorry that whatever you try isn't working, but I think if you explained what it was doing (instead of saying "it's not working"), we'd have some ideas -- we aren't psychic. ;)

Please post an excerpt of what exactly is going on in this thread (one of the originals):

http://www.justlinux.com/forum/showthread.php?s=&threadid=127692

Thank you for understanding.