CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Parallel Port Error

 



UnterDenLinden
New User

Aug 21, 2009, 11:35 AM

Post #1 of 1 (439 views)
Parallel Port Error Can't Post

I'm trying to output to a parallel port on Ubuntu. I'm using the parport (Device::ParallelPort::drv::parport) driver because the Linux (Device::ParallelPort::drv::linux) driver has an error in it. It works fine until I ever stop a program while it is running, it won't let me create the parport driver again with this error:
Device::ParallelPort unabel to create driver parport (see Device::ParallelPort::drv::auto for further information) - Failed to load partport driver for /dev/parport0 at (eval 1) line 3 at motortest.pl line 6

A reboot won't fix it, but it will start working again a few days later. I have no idea.

Here is the code I had written:

Code
#!/usr/bin/perl 

use Device::ParallelPort;


my $parport = Device::ParallelPort->new('parport');

for ($c = 10; $ct >= 1; $c--) {
$parport->set_bit(0, 0);
select(undef,undef,undef, .1);
$parport->set_bit(0, 1);
$parport->set_bit(1, 0);
select(undef,undef,undef, .1);
$parport->set_bit(1, 1);
$parport->set_bit(2, 0);
select(undef,undef,undef, .1);
$parport->set_bit(2, 1);
$parport->set_bit(3, 0);
select(undef,undef,undef, .1);
$parport->set_bit(3, 1);
}


Thanks, sorry I'm kind of new at this.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives