Tk::SevenSegmentDisplay - Perl extension for simulating a seven-segment display
use Tk::SevenSegmentDisplay; my $mw = MainWindow->new(); my $ssd = $mw->SevenSegmentDisplay( -digitwidth => 100, -digitheight => 200, -space => 5, -format => 'dd:dd:dd', -background => '#00FF00', -foreground => '#0000FF' )->pack(); my $ssd = $mw->SevenSegmentDisplay()->pack(); $ssd->configure( -digitwidth => 80, -digitheight => 160, -space => 8, -format => 'ddd.ddd.ddd.ddd', -background => '#0000FF', -foreground => '#FF0000' ); $ssd->CalculateDisplay(); $ssd->repeat(1000, sub { $ssd->SetValue($value); # $ssd->SetInt($value); $ssd->DrawNew(); # $ssd->ChangeColor(); # $ssd->ChangeSequence(); });
Perl extension for simulating a seven-segment display. The display can be changed in size and color. Furthermore can points, colons and hyphens being added.
use Tk::SevenSegmentDisplay; my $mw = MainWindow->new(); my $clock = $mw->SevenSegmentDisplay( -digitwidth => 60, -digitheight => 100, -space => 10, -format => 'dd:dd:dd', -background => '#C0C0C0', -foreground => '#FF0000' ); $clock->CalculateDisplay(); $clock->pack();
Calculates and draws the display new. This function must be called after every initialization or configuration.
Draws the whole display new. Should be called after SetValue() or SetInt is called, to draw the changes of the values.
Exchanges the foreground- and background color. Should be called after SetValue() or SetInt() is called, to show the changes of the values.
Changed the sequence of the segments in the display. Should be called after SetValue() or SetInt() is called, to show the changes of the values.
The first argumet is the number of the digit in the display which is to be changed. The left digit = 1. ddd.ddd 123.456 The second argumet is the value which is to be shown. 0..9
Takes a signed number which is to be shown in the display. To be able to show the sign, the format of the display must begin with a hyphen. '-dddddd'
The width of one digit in pixel. default = 33
The height of one digit in pixel. default = 58
The space between two digits in pixel. default = 3
A string containing: 'd' or 'D' = digit [dD.-:] Examples: 'dd:dd:dd' 'ddd.ddd.ddd.ddd' 'dd-dd-dddd' '-dddddd' default = 'dd.dd'
default = '#00C800'
default = '#006400'
It is a canvas widget which shows the digits.
None by default.
http://freenet-homepage.de/torstenknorr
seven-segment display
Maybe you'll find some. Please let me know.
Torsten Knorr, <create-soft@freenet.de>
Copyright (C) 2009 by Torsten Knorrr
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.9.1 or, at your option, any later version of Perl 5 you may have available.
6 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
You forgot a '=back' before '=head2'
To install Tk::SevenSegmentDisplay, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tk::SevenSegmentDisplay
CPAN shell
perl -MCPAN -e shell install Tk::SevenSegmentDisplay
For more information on module installation, please visit the detailed CPAN module installation guide.