https://github.com/mampersat/micropython-morsecode
MicroPython Morse Code
https://github.com/mampersat/micropython-morsecode
Last synced: 2 days ago
JSON representation
MicroPython Morse Code
- Host: GitHub
- URL: https://github.com/mampersat/micropython-morsecode
- Owner: mampersat
- Created: 2017-03-28T23:07:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-08T02:01:47.000Z (about 1 month ago)
- Last Synced: 2025-03-08T03:17:41.073Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 8
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-micropython - micropython-morsecode - Blink an LED with Morse Coded message. (Libraries / Display)
- awesome-mpython - micropython-morsecode - Blink an LED with morse coded message. (精选驱动库 / 显示类)
README
MicroPython Morse Code
======================## Blink an LED with morse coded message
The library contains a class called Morse, this class has 2 functions, `flash()` which flashes the the pin specified when initializing the class for a the period of time specified in the arguments of the function, and the second function, `send()` that takes in the message you want to flash as an argument and flashes it the pin specified when initializing the class.### Default values
| Function | Value | Value 2 |
|----------|-------------|----------|
| __init__ | pin = 25 | wpm = 15 |
| flash | t = 0.5 | |
| send | msg = "SOS" | |## Example main.py
Blink the phrase 'Hello World!" in morse code```py
from morsecode import Morsedef main() -> None:
code = Morse(12, 20) # Initialize with pin 12 and 20 WPM
code.send("Hello World!") # Send the message "Hello World!" in Morse codeif __name__ == "__main__":
main() # Run the main function
```