Device-Chip-MAX7219
view release on metacpan or search on metacpan
lib/Device/Chip/MAX7219.pm view on Meta::CPAN
await $chip->limit( $columns );
Sets the scan limit register. C<$value> must be between 1 and 8, to set
between 1 and 8 digits. This should only be used to adjust for the number of
LED digits or columns units physically attached to the chip; not for normal
display blanking, as it affects the overall intensity.
I<Note> that this is not directly the value written to the C<LIMIT> register.
=cut
async method limit ( $columns )
{
$columns >= 1 and $columns <= 8 or
croak "->limit columns must be between 1 and 8";
await $self->_writereg( REG_LIMIT, $columns - 1 );
}
=head2 shutdown
await $chip->shutdown( $off );
Sets the shutdown register, entirely blanking the display and turning off all
output if set to a true value, or restoring the display to its previous
content if set false.
I<Note> that this is not directly the value written to the C<SHUTDOWN>
register.
=cut
async method shutdown ( $off )
{
await $self->_writereg( REG_SHUTDOWN, !$off );
}
=head2 displaytest
await $chip->displaytest( $on );
Sets the display test register, overriding the output control and turning on
every LED if set to a true value, or restoring normal operation if set to
false.
=cut
async method displaytest ( $on )
{
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= ..
2=. .. ..
3=. ....
4=.. ..
5=.. .. .
6=..... .
7= ...
8=.......
9=.. ....
A=... ...
B=.....
C= ... .
D=. ....
E=.... .
F=... .
-=.
=
( run in 0.832 second using v1.01-cache-2.11-cpan-71847e10f99 )