/dev/par1

bridged with qdn.public.ddk.printer
Post Reply
Yale Robotics Lab

/dev/par1

Post by Yale Robotics Lab » Mon Feb 24, 2003 7:04 pm

Hi,
I'm trying to do parallel port IO under QNX 6.2, for testing purposes,
I'm running something like this:

fd = open("/dev/par1",O_WRONLY)
/*check for fail*/
for(data = 0;data<256;data++)
{
write(fd,&data,sizeof(data));
/*check for fail*/
getc(stdin);
}

When run, the program opens, and writes without fail, but a scope on the
parallel port shows no change in output. Any ideas?

Also, if there's any site that ya'll know of which can show me how to do
parallel port IO, either through devc-par or otherwise, it'd be greatly
appreciated.

Thanks,

Dan

David Bacon

Re: /dev/par1

Post by David Bacon » Sat Mar 01, 2003 4:33 pm

Unless you've declared "data" as "unsigned char", I'd say you're probably
trying to write 4 bytes at a time, only one of which is usually non-zero.
What is your "check for fail", by the way? You appear to be ignoring the
return value from write().

dB

"Yale Robotics Lab" <lab@cs.yale.edu> wrote in message
news:b3dpgc$p9s$1@inn.qnx.com...
Hi,
I'm trying to do parallel port IO under QNX 6.2, for testing purposes,
I'm running something like this:

fd = open("/dev/par1",O_WRONLY)
/*check for fail*/
for(data = 0;data<256;data++)
{
write(fd,&data,sizeof(data));
/*check for fail*/
getc(stdin);
}

When run, the program opens, and writes without fail, but a scope on the
parallel port shows no change in output. Any ideas?

Also, if there's any site that ya'll know of which can show me how to do
parallel port IO, either through devc-par or otherwise, it'd be greatly
appreciated.

Thanks,

Dan

Post Reply

Return to “qdn.public.ddk.printer”