And a slight update to include punctuation in the Morse table (and thus a doubling of the table size), but not non-english characters atm.
Except it's without the $ sign (it would require another doubling of the table since it is the only character that was 7 morse signals long - seems they could'nt use any of the other 60-ish vacant positions for that one. Not that its impossible I just didn't do that for now. Also it's not difficult to include - just double the table in the same manner as I just did. (Plus of course the table should be put in PROGMEN, but that's for another time).
There are some other things not really supported, like the close-parenthesis that can also be an open-parenthesis (how they transmit math I'm not sure of) - then again wikipedia also lists the open-parenthesis just above it in the dichotomic three. So that's where I put it.
Instead of posting two new posts with the entire thing (+ Im sure I will update it still further, and then I might do that anyway), I just posts the changes for now.
Change the old lines containing this:
const int morseTreetop = [glow]31[/glow]; // character position of the binary morse tree top.
into this:
// character index position of the binary morse tree top.
//const int morseTreetop = 31; // This is for ITU international Morse Code (no punctuation)
const int morseTreetop = [glow]63[/glow]; // This is for ITU with puncutation, but without non-english extensions
And this old line just below it:
// Morse code binary tree table (or, dichotomic search table)
char morseTable[] = "5H4S?V3I?F?U??2E?L?R???A?P?W?J1 6B?D?X?N?C?K?Y?T7Z?G?Q?M8??O9?0";
into this:
// Morse code binary tree table (or, dichotomic search table)
// This is the table for ITU with punctuation (but without non-english characters - for now)
char morseTable[] = "*5*H*4*S***V*3*I***F***U?*_**2*E***L\"**R*+.****A***P@**W***J'1* *6-B*=*D*/"
"*X***N***C;*!K*()Y***T*7*Z**,G***Q***M:8*****O*9***0*";
// ITU - International Morse code table only
//char morseTable[] = "5H4S?V3I?F?U??2E?L?R???A?P?W?J1 6B?D?X?N?C?K?Y?T7Z?G?Q?M8??O9?0";
In addition a little bug fix at the almost very bottom of the old source code:
Change this:
// Write out the character if pause is longer than 2/3 dash time (2 dots) and a character received
if ((millis()-spaceTime >= (dotTime*2)) && (morseTableJumper < [glow]16[/glow]))
into this:
// Write out the character if pause is longer than 2/3 dash time (2 dots) and a character received
if ((millis()-spaceTime >= (dotTime*2)) && (morseTableJumper < [glow]((morseTreetop+1)/2)[/glow]))
Ok I hope this was not too confusing.
EDIT: fixed the morseTable string to avoid /* in the string from Coding Badly's nice solution (thanks!).