NAME

Device::SerialPort::Arduino - A friendly way to interface Perl with your Arduino using Device::SerialPort

VERSION

Version 0.07

SYNOPSIS

  use Device::SerialPort::Arduino;

  my $Arduino = Device::SerialPort::Arduino->new(
    port     => '/dev/ttyACM0',
    baudrate => 9600,

    databits => 8,
    parity   => 'none',
  );

  # Reading from Arduino via Serial

  while (1) {
      print $Arduino->receive(), "\n";
  }

  # or with a delay

  while (1) {
      print $Arduino->receive(1), "\n";
  }

  # Send something via Serial

  $Arduino->communicate('oh hi!!11')
    or die 'Warning, empty string: ', "$!\n";

DESCRIPTION

The Device::SerialPort::Arduino is a class which aims to be an easier way to write Perl applications which easily communicate with Arduino. If you'd like to create an application using this module you firstly have to declare many parameters such as port, baudrate, databits etc. Remember that, some parameters such as databits, parity and stopbits, shouldn't be changed for a well serial communication with your Arduino.

METHODS

Here are some methods which will be used to communicate with your device.

$Arduino->receive()

The method receive checks if there's a stream of information via serial port using the method lookfor contained into Device::SerialPort You can also send via receive an integer parameter, if you'd like to delay the recepit of information from your Arduino board.

$arduino->communicate( $chars )

The method communicate simply sends to your Arduino board characters taken as a parameter, using the method write of Device::SerialPort

AUTHOR

Simone 'Syxanash' Marzulli, <syxanash at cpan.org>

DEPENDENCIES

Device::SerialPort ~ http://search.cpan.org/~cook/Device-SerialPort-1.04/SerialPort.pm

SEE ALSO

Carp ~ http://search.cpan.org/~zefram/Carp-1.25/lib/Carp.pm

Time::HiRes ~ http://search.cpan.org/~zefram/Time-HiRes-1.9725/HiRes.pm

http://arduino.cc/playground/Interfacing/PERL

BUGS

Please report any bugs or feature requests to syxanash at cpan.org, I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Device::SerialPort::Arduino

LICENSE AND COPYRIGHT

Copyright 2012 Simone 'Syxanash' Marzulli.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.