Merge branch 'doc/rmt_example_doc_improve' into 'master'

doc(rmt): update README.md file of rmt related example.

See merge request idf/esp-idf!2636
This commit is contained in:
Angus Gratton
2018-09-12 14:58:04 +08:00
2 changed files with 123 additions and 9 deletions
+48 -6
View File
@@ -1,12 +1,18 @@
# RMT Transmit Example
# _RMT Transmit Example_
This example shows how to configure and operate the remote control (RMT) peripheral to transmit a sample message in the [Morse code](https://en.wikipedia.org/wiki/Morse_code).
(See the README.md file in the upper level 'examples' directory for more information about examples.)
Configuration (pin number, etc.) can be modified in the top of the `main/rmt_tx_main.c` file.
This example will shows how to configure and operate the remote control (RMT) peripheral to transmit a sample message in the [Morse code](https://en.wikipedia.org/wiki/Morse_code), it also shows how to transmit custom format of data.
To be able to see and hear the message output by the RMT, connect a LED and a speaker or an earphone (be careful - it may be loud) to the GPIO configured under `RMT_TX_GPIO` define (default is GPIO 18).
## How to Use Example
Example connections:
### Hardware Required
* A development board with ESP32 SoC (e.g., ESP32-DevKitC, ESP-WORVER-KIT, etc.)
* A USB cable for Power supply and programming
* A LED, a speaker or an earphone
Connection :
```
330R LED
@@ -21,5 +27,41 @@ GPIO18 +----/\/\/\----+------|>|-----+ GND
+--------------+ GND
```
### Configure the Project
See the README.md file in the upper level 'examples' directory for more information about examples.
```
make menuconfig
```
* Set serial port under Serial Flasher Options.
### Build and Flash
Build the project and flash it to the board, then run monitor tool to view serial output:
```
make -j4 flash monitor
```
(To exit the serial monitor, type ``Ctrl-]``.)
See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) 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 a LED and a speaker or an earphone (be careful - it may be loud) to the GPIO18(the pin can be changed by modify the definition of `RMT_TX_GPIO` in `main/rmt_tx_main.c`).
Run this example, you will see the following output log:
```
RMT Tx: Transmission complete
RMT Tx: Sample transmission complete
```
## Troubleshooting
* Programming fail
* Hardware connection is not correct: run `make monitor`, and reboot your board to see if there is any output logs.
* The baud rate for downloading is too high: lower your baud rate in the `menuconfig` menu, and try again.
For any technical queries, please open an [issue] (https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.