Converts text to morse code signals
from funny_morse import *
print(code("Morse code")) # -- --- .-. ... . -.-. --- -.. .
audio("play") # To play morse code audio signal for message
audio_file("code.wav", "wave file", sps=44100, freq=800) # To save
window("show", wpm=5, fs=None)
caps_lock("morse")
num_lock("on")
scroll_lock("indicator")
led("blink", device="/dev/ttyUSB0")
servo("tap", device="192.168.1.1")
Parallel("try parallel",
modes=[
play, # can use callables
"window" # can use modes
],
led={
"pin" : 2, # kwargs to led mode
}
).join()
usage: funny_morse [-h] [--wpm WPM] [--fs FS] [-i] [-p] [-a FILENAME] [-w] [-c] [-n] [-s] [-l] [-m] [-P [MODES [MODES ...]]] [message [message ...]]
Convert text to morse code signals ;)
positional arguments:
message Text to translate or blank to take from stdin
optional arguments:
-h, --help show this help message and exit
--wpm WPM Words per minute
--fs FS Farnsworth speed
-i For interactive convertion
-p, --play To play audio signal
-a FILENAME, --audio FILENAME To save audio signal
-w, --window To show on a window
-c, --capsL To show on caps lock indicator
-n, --numL To show on num lock indicator
-s, --scrollL To show on scroll lock indicator
-l, --led To show on LED (required Microcontroller with MicroPython)
-m, --servo To tap using servo motor (required Microcontroller with MicroPython)
-P [MODES [MODES ...]], --parallel [MODES [MODES ...]] For parallel modes
python -m funny_morse --wpm 15 --fs 15 -p hello
Dot width = 80.0 ms Dash width = 240 ms Character space = 240 ms Word space = 560 ms Audio : samples per second = 8000 Tone period = 1.3 ms .... . .-.. .-.. ---
python -m funny_morse -P p w -- now parallelly play audio and show window
Installation is available via pip:
pip install funny-morse # From PYPI
## OR ##
pip install git+https://github.com/nkpro2000sr/funny-morse.git # From github repo