NAME
Device::Firmata - Perl interface to Firmata for the arduino platform.
VERSION
Version 0.57
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
establish serial connection with an Arduino micro-controller. Single argument is the name of the device file mapped to the arduino. Typically '/dev/ttyUSB0' or 'COM9'