Device-ParallelPort-JayCar
view release on metacpan or search on metacpan
my ($this, $id, $delay) = @_;
$this->_checkid($id);
$this->{RELAY}[$id] = 0;
$this->update unless ($delay);
}
# Update the device.
# Need: NA
# Return: NA
# How: Use parport to update byte and then flash it.
sub update {
my ($this) = @_;
foreach my $board (@{$this->{BOARDS}}) {
$this->_parport->set_byte(2, chr($cardmap{$board})); # Prepare
$this->_parport->set_byte(0, chr($this->_byte_calc($board))); # Set data
$this->_parport->set_byte(2, chr($cardmap{$board} + 1)); # Flash bit 1 (strobe)
$this->_parport->set_byte(2, chr($cardmap{$board})); # Undo flash/strobe
}
}
( run in 0.559 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )