This weekend, I got the module lent by Shuhei Terai, my colleague and a great Flash/ActionScript developer a.k.a. Trick7.
Gainer is an environment for user interfaces and media installations. By using the Gainer environment, the user can handle sensors and/or actuators with a PC on various programming environments such as Flash, Max/MSP, Processing and so on.
http://gainer.cc/Main/HomePage?userlang=en
Gainer supports some of LLs, ActionScript and Ruby (with Funnel).
Perl is not supported yet unfortunately.
So I wrote a Perl module named Device::Gainer and submitted on CodeRepos:
http://svn.coderepos.org/share/lang/perl/Device-Gainer/trunk/lib/Device/Gainer.pm
SYNOPSIS:
use Device::Gainer;The module has enough functionality for my purpose, however,
my $gainer = Device::Gainer->new( host => '192.168.1.xx' );
$gainer->on_pressed( sub { print "PRESS\n"; } );
$gainer->on_released( sub { print "RELEASE\n"; } );
$gainer->turn_on_led();
$gainer->turn_off_led();
it's not completed especially for documents and tests.
The following methods are supported currently:
Method | Command |
turn_on_led | h* |
turn_off_led | l* |
digital_output | D____* |
set_high | H_* |
set_low | L_* |
peek_digital_input | R* |
analog_output | a___* |
peek_analog_input | I* |
on_pressed | N* |
on_released | F* |
Anyway, I wrote a proxy server for "Gainer over HTTP" using the Device::Gainer and POE::Component::Server::HTTP module.
Now we can use the Gainer through the Internet!
This means the Gainer Ajax tech can be the hot topics in the Ajax/JavaScript developers as well...
I failed to use Win32::SerialPort module to connect to Gainer module directly.
The original posts of this were written in Japanese.