Thanks!
Here is a schematics (made in Fritzing - first test). At first I used a buzzer like on the schematics, but when I made two, I discovered I only had one of those, but I had some piezo transduzers. Which dont "buzz" by themself but need an alternating signal, which is the IC and stuff in the middle of my breadboard. So in the video I use those. Not included in this schematics, but it's controlled by the Arduino all the same.
The electret microphone preamplifier circuit is a slight modification of what one normally finds. If your electret mic differs, it might not work as good. It is not made for "normal" (dynamic?) microphones! (A resistor and capacitor extra and you can have that too, preferably something more elaborate). I was experimenting a bit with some one-transistor electret preamplifier circuits for another project, when I found it fitted nicely for the morse decoder. I needed something small in component count, but preferably more sensitive than this one. Anyway, the idea is to get an audio signal centered around 2.5V into the analog input.
Of course, if you have an audio morse signal, it would be better to modify the analog input circuit to just plug in a jack from a line-out or something. This was just for testing, and it is sensitive to other nearby sounds also.
The schematics is for the code posted in the first two-three posts, but also works as-is for the endecoder class example. But then only for the button. To use audio as input, you must change the initialization of the decoder class:
int morseInPin = 0;
morseDecoder morseInput(morseInPin, MORSE_AUDIO, MORSE_ACTIVE_HIGH);
(The "MORSE_ACTIVE_HIGH" argument is only used for a digital signal, but must be included anyway for now. It is used to indicate an active-low or active high signal, and uses the internal pull-up resistor if it is acitive-low. When using audio (analog) input it doesn't matter what value it is, as long as it is a boolean (true or false))
