NAME

Device::Firmata - Perl interface to Firmata for the arduino platform.

VERSION

Version 0.64

SYNOPSIS

use strict;
use warnings;

use Device::Firmata::Constants qw/ :all /;
use Device::Firmata;

use Time::HiRes 'sleep';

$|++;

my $led_pin = 13;

my $device = Device::Firmata->open('/dev/ttyUSB0') or die "Could not connect to Firmata Server";
$device->pin_mode($led_pin=>PIN_OUTPUT);
my $iteration = 0;
while (1) {
    my $strobe_state = $iteration++%2;
    $device->digital_write($led_pin=>$strobe_state);
    sleep 0.5;
}

SUBROUTINES/METHODS

open(serialPort)

Establish a serial connection with an Arduino micro-controller. The first argument is the name of the serial device mapped to the arduino, e.g. '/dev/ttyUSB0' or 'COM9'.

listen(host, port)

Start a TCP server bound to given local address and port for the arduino to connect to.

LICENSE

Copyright (C) 2010 amimato
Copyright (C) 2012 ntruchsess
Copyright (C) 2016 jnsbyr

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

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