esp-idf/examples/peripherals/rmt/morse_code/README.md

67 wiersze
2.2 KiB
Markdown
Czysty Zwykły widok Historia

2019-11-19 08:10:24 +00:00
# RMT Transmit Example -- Morse Code
2017-11-20 03:51:30 +00:00
(See the README.md file in the upper level 'examples' directory for more information about examples.)
2017-11-20 03:51:30 +00:00
2019-11-19 08:10:24 +00:00
This example mainly illustrates how to transmit the [Morse code](https://en.wikipedia.org/wiki/Morse_code) using the RMT driver.
2017-11-20 03:51:30 +00:00
## How to Use Example
### Hardware Required
* A development board with ESP32 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
2018-07-15 04:56:23 +00:00
* A USB cable for Power supply and programming
* A LED, a speaker or an earphone
Connection :
```
330R LED
GPIO18 +----/\/\/\----+------|>|-----+ GND
|
| /|
+-+ | Speaker
| | | or
+-+ | earphone
| \|
|
+--------------+ GND
```
### Configure the Project
2019-11-19 08:10:24 +00:00
Open the project configuration menu (`idf.py menuconfig`).
In the `Example Configuration` menu:
2019-11-19 08:10:24 +00:00
* Set the GPIO number used for transmitting the IR signal under `RMT TX GPIO` optin.
2019-11-19 08:10:24 +00:00
### Build and Flash
2019-11-19 08:10:24 +00:00
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
(To exit the serial monitor, type ``Ctrl-]``.)
See the Getting Started Guide for all the steps to configure and use the ESP-IDF to build projects.
* [ESP-IDF Getting Started Guide on ESP32](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html)
* [ESP-IDF Getting Started Guide on ESP32-S2](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/get-started/index.html)
* [ESP-IDF Getting Started Guide on ESP32-C3](https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/get-started/index.html)
2019-11-19 08:10:24 +00:00
## Example Output
2019-11-19 08:10:24 +00:00
To be able to see and hear the message output by the RMT, connect an LED and a speaker or an earphone (be careful it might make a large noise) to the GPIO you set in the menuconfig.
2017-11-20 03:51:30 +00:00
2019-11-19 08:10:24 +00:00
Run the example, you will see the following output log:
``` bash
...
I (304) example: Configuring transmitter
I (2814) example: Transmission complete
...
```
## Troubleshooting
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.