中文文档在这里
AutoMorse is an automatic Morse code encoding library designed for the Raspberry Pi Pico.
It can convert the input text message into Morse code and output it through GPIO (you can connect GPIO to other components such as relays to operate the wireless station).
This library is intended for radio amateurs and users who need automated Morse code sending functionality, and can also be used for teaching and demonstration.
- Supports GPIO control: You can select any GPIO pin as a signal sender and indicator light.
- Adjustable sending speed: You can set the sending speed (in words per minute) according to your needs.
- Standard Morse Code Mapping: Built-in standard Morse code dictionary, supporting letters, numbers and common symbols.
- Error Handling: For invalid characters, an error is signaled.
Download the library file AutoMorse.py
and put it into the lib
folder under the Raspberry Pi Pico file directory.
Call the library file in your main script:
from AutoMorse import AutoMorse
Define the parameters for the Morse code transmission:
morse = AutoMorse(buzzer_pin, led_pin, wpm)
Here, buzzer_pin
and led_pin
are the GPIO pins for the buzzer and LED respectively, and wpm
is the sending speed in words per minute.
Convert the message you want to send into a list and process it using the library:
phrase = list(content)
morse.Morse(phrase)
Here, content
is the text message to be converted. The Morse
method will handle the conversion and transmission.
- Ensure all characters in your message are valid Morse code characters. For invalid characters, the library will signal an error.
- If you encounter issues with GPIO control, double-check your pin connections and configurations.