diff --git a/examples/peripherals/mcpwm/mcpwm_capture_hc_sr04/README.md b/examples/peripherals/mcpwm/mcpwm_capture_hc_sr04/README.md index db86e48133..8f30c99f8b 100644 --- a/examples/peripherals/mcpwm/mcpwm_capture_hc_sr04/README.md +++ b/examples/peripherals/mcpwm/mcpwm_capture_hc_sr04/README.md @@ -13,7 +13,7 @@ The signal that HC-SR04 produces (and what can be handled by this example) is a Typical signals: -``` +```text Trig +-----+ | | | | @@ -36,19 +36,21 @@ Echo +-----+ Connection : +```text + +------+ +--------------------------------------+ ++-------+ | | | +| | VCC +--------------+ 5V | ++-------+ | | | + + Echo +----=====>----+ HC_SR04_ECHO_GPIO (internal pull up) | + | | | | + + Trig +----<=====----+ HC_SR04_TRIG_GPIO | ++-------| | | | +| | GND +--------------+ GND | ++-------| | | | + +------+ +--------------------------------------+ ``` - +------+ +---------------------------------+ -+-------+ | | | -| | VCC +--------------+ 5V | -+-------+ | | | - + Echo +----=====>----+ GPIO18 (internal pull up) | - | | | | - + Trig +----<=====----+ GPIO19 | -+-------| | | | -| | GND +--------------+ GND | -+-------| | | | - +------+ +---------------------------------+ -``` + +You can change the GPIO number according to your board, by `HC_SR04_TRIG_GPIO` and `HC_SR04_ECHO_GPIO` in the [source code](main/mcpwm_capture_hc_sr04.c). ### Build and Flash @@ -60,7 +62,7 @@ See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/l ## Example Output -``` +```text I (0) cpu_start: Starting scheduler on APP CPU. I (304) example: Create capture queue I (304) example: Install capture timer @@ -78,7 +80,7 @@ I (734) example: Pulse width: 188.98us, Measured distance: 3.26cm I (834) example: Pulse width: 188.99us, Measured distance: 3.26cm ``` -This example runs at 10Hz sampling rate. Measure data that out of the range is dropped and only valid measurement is printed out. +This example runs at 10 Hz sampling rate. Measure data that out of the range is dropped and only valid measurement is printed out. ## Troubleshooting diff --git a/examples/peripherals/pcnt/rotary_encoder/README.md b/examples/peripherals/pcnt/rotary_encoder/README.md index c6c342b0a4..47765353ad 100644 --- a/examples/peripherals/pcnt/rotary_encoder/README.md +++ b/examples/peripherals/pcnt/rotary_encoder/README.md @@ -6,13 +6,14 @@ (See the README.md file in the upper level 'examples' directory for more information about examples.) The PCNT peripheral is designed to count the number of rising and/or falling edges of an input signal. Each PCNT unit has two channels, which makes it possible to extract more information from two input signals than only one signal. -This example shows how to make use of the HW features to decode the differential signals generated from a common rotary encoder -- [EC11](https://tech.alpsalpine.com/prod/e/html/encoder/incremental/ec11/ec11_list.html). + +This example shows how to make use of the HW features to decode the differential signals generated from a common rotary encoder -- [EC11](https://tech.alpsalpine.com/e/products/category/encorder/sub/01/series/ec11e/). The signals a rotary encoder produces (and what can be handled by this example) are based on a 2-bit gray code available on 2 digital data signal lines. The typical encoders use 3 output pins: 2 for the signals and one for the common signal usually GND. Typical signals: -``` +```text A +-----+ +-----+ +-----+ | | | | | | | | @@ -35,7 +36,7 @@ B +-----+ +-----+ +-----+ Connection : -``` +```text +--------+ +---------------------------------+ | | | | | A +--------------+ GPIO_A (internal pull up) | @@ -49,11 +50,11 @@ Connection : +--------+ +---------------------------------+ ``` -The GPIO used by the example can be changed according to your board by `EXAMPLE_EC11_GPIO_A` and `EXAMPLE_EC11_GPIO_B` in [source file](main/rotary_encoder_example_main.c); +The GPIO used by the example can be changed according to your board by `EXAMPLE_EC11_GPIO_A` and `EXAMPLE_EC11_GPIO_B` in [source file](main/rotary_encoder_example_main.c). ### Build and Flash -By configuring one of the EC11 GPIO (e.g. `EXAMPLE_EC11_GPIO_A`) as a wake up source, we can make the rotary encoder wake the system from light sleep. This example can illustrate this feature if you enable the `EXAMPLE_WAKE_UP_LIGHT_SLEEP` from the menuconfig. +By configuring one of the EC11 GPIO (e.g. `EXAMPLE_EC11_GPIO_A`) as a wake up source, you can make the rotary encoder wake the system from light sleep. This example can illustrate this feature if you enable the `EXAMPLE_WAKE_UP_LIGHT_SLEEP` from the menuconfig. Run `idf.py -p PORT flash monitor` to build, flash and monitor the project. @@ -63,7 +64,7 @@ See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/l ## Example Output -``` +```text I (0) cpu_start: Starting scheduler on APP CPU. I (325) example: install pcnt unit I (335) example: set glitch filter