I've got an update. Today I got a set of little patch cables in the mail and hooked up an old single-digit LED display to seven of the GPIO ports. I then added these subroutines to my library:
sub bar { my @bar = @_; for my $pin (@pins) { Device::BCM2835::gpio_write( $pin, 0 ); } Device::BCM2835::delay( 40 ); for my $pin (@pins) { my $val = shift @bar; Device::BCM2835::gpio_write( $pin, 1 ) if $val == 1; } Device::BCM2835::delay( 240 ); } sub bilanidin { while ($_ = lc shift) { print "$_\n"; bar( qw/1 0 1 0 1 0 1 1/ ) if /a/; bar( qw/0 0 0 0 0 1 0 1/ ) if /b/; bar( qw/1 0 1 1 0 1 1 1/ ) if /ch/; bar( qw/1 0 0 0 1 1 0 0/ ) if /d/; bar( qw/1 0 0 1 0 1 1 0/ ) if /e/; bar( qw/1 0 0 0 1 0 0 1/ ) if /g/; bar( qw/0 0 0 1 0 1 1 0/ ) if /[ijy]/; bar( qw/1 0 0 1 1 0 1 0/ ) if /[kq]/; bar( qw/0 0 1 1 1 1 0 0/ ) if /l/; bar( qw/0 0 1 1 0 0 1/ ) if /m/; bar( qw/0 0 1 1 1 0 0 1/ ) if /n/; bar( qw/1 0 0 0 1 1 1 1/ ) if /o/; bar( qw/0 0 1 1 0 1 1 0/ ) if /p/; bar( qw/0 0 1 0 0 0 1 1/ ) if /r/; bar( qw/0 0 1 1 1 0 1 0/ ) if /s/; bar( qw/0 0 1 0 1 0 1 1/ ) if /t/; bar( qw/0 0 1 0 0 0 1 0/ ) if /[huvw]/; bar( qw/1 0 1 1 1 0 1 0/ ) if /x/; bar( qw/0 0 0 1 0 0 1 1/ ) if /z/; } Device::BCM2835::delay( 400 ); bar( qw/0 0 0 0 0 0 0 0/ ); }
"Bilanidin" is a font designed by Marc Miller for the Traveller pencil-and-paper RPG. I adapted it to the display as closely as I could.

Now my little server can talk to me in bilanidin letters as well as Morse code. This is a lot of fun.


In reply to Re: LED blinking Morse code from Raspberry Pi by rje
in thread LED blinking Morse code from Raspberry Pi by rje

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.