![]() ![]() 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. (Plus of course the table should be put in PROGMEN, but that's for another time). Also it's not difficult to include - just double the table in the same manner as I just did. Not that its impossible I just didn't do that for now. save last state of the morse signal for debouncingĪnd a slight update to include punctuation in the Morse table (and thus a doubling of the table size), but not non-english characters atm.Įxcept 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. while there is a signal, reset some flags If ((millis()-spaceTime >= (dotTime*2)) & (morseTableJumper (wordSpace*2/3) & morseSpace = false) Write out the character if pause is longer than 2/3 dash time (2 dots) and a character received ![]() if signal for less than half a dash, take it as a dot, else if not, take it as a dash if signal for more than 1/4 dotTime, take it as a valid morse pulse if pause for more than half a dot, get what kind of signal pulse (dot/dash) received last If (sendingMorseSignalNr >= morseSignals) sendingMorse = false // Ready to encode more letters If (millis() - sendMorseTimer > wordSpace - dashTime) sendingMorse = false SendMorseTimer = millis() // reset the timerĬase ' ': // Pause between words (minus pause between letters - already sent)ĭefault: // Just in case its something else If (millis() - sendMorseTimer >= dashTime)Ĭase 'x': // To make sure there is a pause between signals and lettersĭigitalWrite(morseOutPin, HIGH) // Start sending the next signal MorseSignal = 'x' // Mark the signal as sentĬase '-': // Send a dash (same here, stop sending after a dash worth of time) build the morse signal (backwards from last signal to first) Scan for the character to send in the Morse table Serial.println(" Unrecognized command 'Z') encodeMorseChar -= 'z'-'Z' Serial.println(" > Echo: on Echo: off Morse speed (wpm):") Expects (and wait for) 2 or 4 characters (>i or Audio threshold:") An extremely crude and simple command parser if a command instead, adjust some settings If (Serial.available() > 0 & !sendingMorse) Part #2: // Encode Morse code or execute commands If (!sendingMorse & morseEcho) digitalWrite(morseOutPin, morseSignalState) Morse output, or a feedback when keying. MorseSignalState = false // No more signal SpaceTime = lastDebounceTime // not too far off from last received audio If (currentTime - lastDebounceTime > dotTime/2 & morseSignalState = true) if this is a new pause, reset space time MorseSignalState = true // there is currently a signal If (currentTime - lastDebounceTime > dotTime/2) If this is a new morse signal, reset morse signal timer If (!morseKeyer & millis() - lastDebounceTime > 1000) listeningAudio = true If no manual morse keying the last second, enter audio listen mode If (morseSignalState) markTime = lastDebounceTime else spaceTime = lastDebounceTime than the debounce delay, so take it as the actual current state: whatever the reading is at, it's been there for longer Set high enough to avoid noise, low enough to get signal Simple analog input signal threshold (512 = middle-ish) Make functions or classes out of it sometime. TODO: Make the timings signed long again, to avoid rollover issue Thus using the same Morse table / binary tree for encoding and decoding.Ģ010.11.28 - Added a simple audio Morse signal filter. Using a binary tree (dichotomic table) for Morse decodingĢ010.11.27 - Added Morse encoding via reverse-dichotomic path tracing. Only International Morse Code (letters A-Z, numbers), and space, areĮncoded and sent as Morse code automatically unless whatever the "command"ġ992.01.06 - Morse decoder 3.5 - 68000 Assembler version for the Amiga 600 ![]() It will enter audio listen mode if nothing is keyed in within a second. ASCII text via serial communication (for decoded Morse). Morse-code toggled output pin (for encoded Morse). ![]() ASCII text via serial communication (for encoding. Morse keying on digital input (for decoding). Audio Morse signals on an analog input (for decoding). A Morse encoder / decoder for the Arduino.ģ input methods for decoding and encoding: My camera aiming is a bit off though, and the video editing isn't the best either. ![]()
0 Comments
Leave a Reply. |