Device-MiniLED

 view release on metacpan or  search on metacpan

lib/Device/MiniLED.pm  view on Meta::CPAN


=item
B<baudrate>:
defaults to 38400, no real reason to use something other than the default, but it's there if you feel the need.  Must be a value that Device::Serialport or Win32::Serialport thinks is valid

=item
B<packetdelay>: An amount of time, in seconds, to wait, between sending packets to the sign.  The default is 0.20.  If you see "XX" displayed on your sign while sending data, increasing this value may help.  Must be greater than zero.

=over

=item
B<Note>: For reference, each text message generates 3 packets, and each 16x32 portion of an image sends one packet.  There's also an additional, short, packet sent after all message and image packets are delivered. So, if you make packetdelay a large...

=back

=back

Examples of using $sign->send

  # typical use on a windows machine
  $sign->send(
      device => "COM4"
  );
  # typical use on a unix/linux machine
  $sign->send(
      device => "/dev/ttyUSB0"
  );
  # using optional arguments, set baudrate to 9600, and sleep 1/2 a second
  # between sending packets.  
  $sign->send(
      device => "COM8",
      baudrate => "9600",
      packetdelay => 0.5
  );

Note that if you have multiple connected signs, you can send to them without creating a new object:

  # send to the first sign
  $sign->send(device => "COM4");
  # send to another sign
  $sign->send(device => "COM6");
  # send to a badge connected on COM7
  #   this works fine for plain text, but won't work well for
  #   pictures and icons...you'll have to create a new
  #   sign object with devicetype "badge" for them to render correctly
  $sign->send(device => "COM7"); 
 
Using the showslots parameter. Also see the "slot" parameter under L<< /"$sign->addMsg" >>.


  #
  # showslots is a string, with the numbers of the messages you want
  # displayed separated by commas
  #
  $sign->send(device => "/dev/ttyUSB0",
              showslots => "1,5,7"
  ); 

=head1 AUTHOR

Kerry Schwab, C<< <sales at brightledsigns.com> >>

=head1 SUPPORT

You can find documentation for this module with the perldoc command.
  
  perldoc Device::MiniSign
  
Other links that may be helpful:

=over 

=item *
Our website: L<brightledsigns.com|http://www.brightledsigns.com/>

=item *
Our L<page for developers|http://www.brightledsigns.com/developers>

=item *
The signs that work with this api are L<here|http://www.brightledsigns.com/scrolling-led-signs.html>.  They are the first three shown, the badge, the "micro sign" and the "mini sign".

=back
 
=head1 BUGS

Please report any bugs or feature requests to
C<bug-device-miniled at rt.cpan.org>, or through the web interface at
L<http://rt.cpan.org>.  I will be notified, and then you'll automatically be
notified of progress on your bug as I make changes.

=head1 TODO

=over

=item
B<Font Upload>: The signs only natively support one line of text, but they do support uploading and replacing the native font.  The native font that comes with the sign is 12 pixels tall, I suppose to allow for the effect that outlines the text in a ...

=item
B<Emulating 2 lines of text>:  If we provided a way to render smaller fonts, like a standard 5x7 LED font, into a pixmap, you could present two lines of text on the sign, abeit, only as a picture via addPix.

=item
B<Migration of this code to a more generic module>: Need a better module structure that supports other models of LED signs that use a different protocol.  Like LEDSign::Mini  LEDSign:OtherModel, etc.

=item
B<Porting this to python>:  I'm much better with Perl, but it's not as popular as it used to be.  Porting to python might open up a wider user base for the signs.

=back

=head1 ACKNOWLEDGEMENTS

I was able to leverage some existing work I found, though none of these examples reverse engineered the protocol to the same degree that we've done in this API. Here's what I found:

=over 4

=item * L<http://zunkworks.com/ProgrammableLEDNameBadges> - Some code samples for different types of LED badges. The last one, "Badge Three", uses the same protocol we're targeting here.

=item * L<https://github.com/ajesler/ledbadge-rb> - Ruby library that appears to be targeting led badges with a very similar protocol. 

=item * L<https://github.com/danzel/CodemaniaBadge> - A game, written in C#, that uses LED badges.  Also has some protocol information and C# code.  Targeting the same type of signs/badges.

=item * L<https://github.com/ghewgill/ledbadge> - Python code, again, using the same protocol. 

=back

Other Cpan modules related to Led Signs

=over

=item * L<http://search.cpan.org/~mspencer/ProLite-0.01/ProLite.pm> - The only other CPAN perl module I could find that does something similar, albeit for a different type of sign.

=back

=head1 LICENSE AND COPYRIGHT

Copyright 2013 Kerry Schwab.

This program is free software; you can redistribute it and/or modify it
under the terms of the the Artistic License (2.0). You may obtain a
copy of the full license at:



( run in 0.513 second using v1.01-cache-2.11-cpan-71847e10f99 )