Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: LED blinking Morse code from Raspberry Pi

by choroba (Cardinal)
on Aug 30, 2014 at 19:28 UTC ( [id://1099092] : note . print w/replies, xml ) Need Help??


in reply to LED blinking Morse code from Raspberry Pi

I would probably use a more declarative approach to the Morse code:
my %morse = ( a => '.-', b => '-...', c => '-.-.', d => '-..' , e => '.', f => '..-.', g => '--.', h => '....', i => '..' , j => '.---', k => '-.-', l => '.-..', m => '--', n => '-.', o => '---', p => '.--.', q => '--.-', r => '.-.', s => '...', t => '-', u => '..-', v => '...-', w => '.--', x => '-..-', y => '-.--', z => '--..', ' ' => ' ' , ); key $morse{$_} for split //, lc shift;
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ