mirror of
https://github.com/alexandrebobkov/ESP-Nodes.git
synced 2025-08-24 19:05:59 +00:00
ESP IDF Robot
This commit is contained in:
@@ -14,12 +14,22 @@
|
|||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "freertos/queue.h"
|
#include "freertos/queue.h"
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
|
#include "driver/ledc.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "led_strip.h"
|
#include "led_strip.h"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
static const char *TAG = "ESP IDF Robot";
|
static const char *TAG = "ESP IDF Robot";
|
||||||
|
|
||||||
|
// LED
|
||||||
|
#define LEDC_TIMER LEDC_TIMER_0
|
||||||
|
#define LEDC_MODE LEDC_LOW_SPEED_MODE
|
||||||
|
#define LEDC_OUTPUT_IO (3) // Define the output GPIO
|
||||||
|
#define LEDC_CHANNEL LEDC_CHANNEL_0
|
||||||
|
#define LEDC_DUTY_RES LEDC_TIMER_13_BIT // Set duty resolution to 13 bits
|
||||||
|
#define LEDC_DUTY (4096) // Set duty to 50%. (2 ** 13) * 50% = 4096
|
||||||
|
#define LEDC_FREQUENCY (4000) // Frequency in Hertz. Set frequency at 4 kHz
|
||||||
|
|
||||||
/* Use project configuration menu (idf.py menuconfig) to choose the GPIO to blink,
|
/* Use project configuration menu (idf.py menuconfig) to choose the GPIO to blink,
|
||||||
or you can edit the following line and set a number here.
|
or you can edit the following line and set a number here.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user