esp-idf/examples/peripherals/rmt/morse_code
Angus Gratton 66fb5a29bb Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)
2020-11-11 07:36:35 +00:00
..
main rmt: refactor examples 2019-11-20 10:54:21 +08:00
CMakeLists.txt rmt: refactor examples 2019-11-20 10:54:21 +08:00
Makefile Whitespace: Automated whitespace fixes (large commit) 2020-11-11 07:36:35 +00:00
README.md rmt: refactor examples 2019-11-20 10:54:21 +08:00

RMT Transmit Example -- Morse Code

(See the README.md file in the upper level 'examples' directory for more information about examples.)

This example mainly illustrates how to transmit the Morse code using the RMT driver.

How to Use Example

Hardware Required

  • A development board with ESP32 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
  • 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

Open the project configuration menu (idf.py menuconfig).

In the Example Connection Configuration menu:

  • Set the GPIO number used for transmitting the IR signal under RMT TX GPIO optin.

Build and Flash

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 full steps to configure and use ESP-IDF to build projects.

Example Output

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.

Run the example, you will see the following output log:

...
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.