Device-Chip-MAX7219

 view release on metacpan or  search on metacpan

lib/Device/Chip/MAX7219.pm  view on Meta::CPAN

   await $self->_writereg( REG_DTEST, $on );
}

=head1 AUTHOR

Paul Evans <leonerd@leonerd.org.uk>

=cut

while( readline DATA ) {
   my ( $hex, $segments ) = split m/=/;
   my $bits = 0;
   substr( $segments, $_, 1 ) eq "." and $bits += 1 << $_ for 0 .. 6;
   $hex2bits{$hex} = $bits;
}

0x55AA;

__DATA__
0= ......
1=    .. 

lib/Device/Chip/MAX7219Panel.pm  view on Meta::CPAN

      "######",
      "######",
      "   ## ",
      "   #  " );

=cut

method draw_blit ( $x0, $y, @lines )
{
   for( ; @lines; $y++ ) {
      my @pixels = split m//, shift @lines;
      @pixels or next;

      my $x = $x0;
      for( ; @pixels; $x++ ) {
         my $p = shift @pixels;

         $p eq " " ? next :
         $p eq "-" ? ( $_display[$y][$x] = 0 ) :
                     ( $_display[$y][$x] = 1 );



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