Sep 10, 2012

HowTo: Perl Serial Port Fedora 17

1. yum install -y perl-Device-SerialPort
2. usermod -a -G dialout user
     (replace user with your username)
3. log-out or restart computer
4. your user is now allowed to read / write on Serial Port
5. below is a sample of a perl program for a push button I made for a serial port. When I push on the button, Pin 2 and 4 are shorted.


use strict;
use Device::SerialPort;

my $port = new Device::SerialPort("/dev/ttyS0"); 

my ($count_in, $string_in) = $port->read(255);
if($count_in > 0){

No comments:

Post a Comment