Examples: Add READMEs for examples which did not have them
Closes github #128 https://github.com/espressif/esp-idf/issues/128
This commit is contained in:
parent
a760eb3980
commit
2f9772860a
5 changed files with 42 additions and 12 deletions
6
examples/11_rmt_nec_tx_rx/README.md
Normal file
6
examples/11_rmt_nec_tx_rx/README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Example: rmt_nec_tx_rx
|
||||
|
||||
This example uses the remote control (RMT) peripheral to transmit and receive codes for the NEC infrared remote protocol.
|
||||
|
||||
Configuration (pin numbers, etc.) can be modified in top of the main/infrared_nec.c file.
|
||||
|
3
examples/13_timer_group/README.md
Normal file
3
examples/13_timer_group/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Example: timer_group
|
||||
|
||||
This example uses the timer group driver to generate timer interrupts at two specified alarm intervals.
|
14
examples/16_pcnt/README.md
Normal file
14
examples/16_pcnt/README.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Example: pcnt
|
||||
|
||||
This example uses the pulse counter module (PCNT) to count the rising edges of pulses generated by the LED Controller module (LEDC).
|
||||
|
||||
By default GPIO18 is used as output pin, GPIO4 is used as pulse input pin and GPIO5 is used as control input pin. This configuration (pin numbers, etc.) can be modified in top of the main/pcnt_test.c file.
|
||||
|
||||
* Open serial port to view the message printed on your screen
|
||||
* To do this test, you should connect GPIO18 with GPIO4
|
||||
* GPIO5 is the control signal, you can leave it floating with internal pulled up, or connect it to ground. HIGH = Count increases, LOW = count decreases.
|
||||
* An interrupt is configured to trigger when the count reaches threshold values.
|
||||
* The counter will reset when it reaches the limit values.
|
||||
|
||||
|
||||
|
|
@ -36,14 +36,14 @@
|
|||
* When counter value reaches thresh1 or thresh0 value, it will trigger interrupt.
|
||||
* When counter value reaches l_lim value or h_lim value, counter value will be reset to zero and trigger interrupt.
|
||||
*/
|
||||
#define PCNT_TEST_UNIT PCNT_UNIT_0
|
||||
#define PCNT_H_LIM_VAL (10)
|
||||
#define PCNT_L_LIM_VAL (-10)
|
||||
#define PCNT_THRESH1_VAL (5)
|
||||
#define PCNT_THRESH0_VAL (-5)
|
||||
#define PCNT_INPUT_SIG_IO (4)
|
||||
#define PCNT_INPUT_CTRL_IO (5)
|
||||
#define LEDC_OUPUT_IO (18)
|
||||
#define PCNT_TEST_UNIT PCNT_UNIT_0
|
||||
#define PCNT_H_LIM_VAL 10
|
||||
#define PCNT_L_LIM_VAL -10
|
||||
#define PCNT_THRESH1_VAL 5
|
||||
#define PCNT_THRESH0_VAL -5
|
||||
#define PCNT_INPUT_SIG_IO 4 /* Pulse Input GPIO */
|
||||
#define PCNT_INPUT_CTRL_IO 5 /* Control GPIO HIGH=count up, LOW=count down */
|
||||
#define LEDC_OUTPUT_IO 18 /* Output GPIO */
|
||||
|
||||
xQueueHandle pcnt_evt_queue; /*A queue to handle pulse counter event*/
|
||||
|
||||
|
@ -96,8 +96,8 @@ void IRAM_ATTR pcnt_intr_handler(void* arg)
|
|||
static void ledc_init(void)
|
||||
{
|
||||
ledc_channel_config_t ledc_channel;
|
||||
/*use GPIO18 as output pin*/
|
||||
ledc_channel.gpio_num = LEDC_OUPUT_IO;
|
||||
/*use LEDC_OUTPUT_IO as output pin*/
|
||||
ledc_channel.gpio_num = LEDC_OUTPUT_IO;
|
||||
/*LEDC high speed mode */
|
||||
ledc_channel.speed_mode = LEDC_HIGH_SPEED_MODE;
|
||||
/*use LEDC channel 1*/
|
||||
|
@ -125,9 +125,9 @@ static void ledc_init(void)
|
|||
static void pcnt_init(void)
|
||||
{
|
||||
pcnt_config_t pcnt_config = {
|
||||
/*Set GPIO4 as pulse input gpio */
|
||||
/*Set PCNT_INPUT_SIG_IO as pulse input gpio */
|
||||
.pulse_gpio_num = PCNT_INPUT_SIG_IO,
|
||||
/*set gpio5 as control gpio */
|
||||
/*set PCNT_INPUT_CTRL_IO as control gpio */
|
||||
.ctrl_gpio_num = PCNT_INPUT_CTRL_IO,
|
||||
/*Choose channel 0 */
|
||||
.channel = PCNT_CHANNEL_0,
|
||||
|
|
7
examples/19_sigmadelta/README.md
Normal file
7
examples/19_sigmadelta/README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Example: sigma_delta modulation
|
||||
|
||||
This example uses the sigma_delta output modulation driver to generate modulated output on a GPIO.
|
||||
|
||||
By default the GPIO output is 4, however you can edit this in the `sigmadelta_init()` function inside `main/sigmadelta_test.c`.
|
||||
|
||||
If you connect an LED to the output GPIO, you will see it blinking slowly.
|
Loading…
Reference in a new issue