Converts text to morse code signals [audio, window, keyboardleds, led, servo]
Project description
Funny Morse
Converts text to morse code signals
Examples
from funny_morse import *
print(code("Morse code")) # -- --- .-. ... . -.-. --- -.. .
Audio
audio("play") # To play morse code audio signal for message
audio_file("code.wav", "wave file", sps=44100, freq=800) # To save
Window
window("show", wpm=5, fs=None)
Keyboard Leds
caps_lock("morse")
num_lock("on")
scroll_lock("indicator")
Pyboard
led("blink", device="/dev/ttyUSB0")
servo("tap", device="192.168.1.1")
Parallel
Parallel("try parallel",
modes=[
play, # can use callables
"window" # can use modes
],
led={
"pin" : 2, # kwargs to led mode
}
).join()
CLI Examples
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 .... . .-.. .-.. ---
Parallel
python -m funny_morse -P p w -- now parallelly play audio and show window
Installation
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
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
funny-morse-0.0.1.tar.gz
(9.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file funny-morse-0.0.1.tar.gz.
File metadata
- Download URL: funny-morse-0.0.1.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.3 Linux/5.4.44-1-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ec942733e1284d6fae641e83857b9455b1fa92b394e4e863326136d37aac3d1
|
|
| MD5 |
944d189980dead3173c3a607d49d09f4
|
|
| BLAKE2b-256 |
731d998e835b43c936cbb872e4c4159d0c55eca7f238cd05ed3eabfe7269126c
|
File details
Details for the file funny_morse-0.0.1-py3-none-any.whl.
File metadata
- Download URL: funny_morse-0.0.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.3 Linux/5.4.44-1-MANJARO
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bdcbd7d1660323640e067643179cb8f6f07d7e97a1b618251970de083e12628
|
|
| MD5 |
38583759ab75b1938ed0c47c3e7a9c89
|
|
| BLAKE2b-256 |
f5c20e6195f29dc0e5db37373ff768b96e8587453ca9b449d1374158d65bfac4
|