/dev/par1

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

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