Page 1 of 1

problem with LED

Posted: Mon Nov 04, 2024 4:43 pm
by jsmith56x
I'm trying to turn on the built in LED on ESP32-C3-DevKitM-1 but it does not works.
What I made wrong?

Code: Select all

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <inttypes.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "driver/gpio.h"

#define GPIO_BIT_MASK  ((1ULL<<GPIO_NUM_8) | (1ULL<<GPIO_NUM_9)) 

void app_main() 
{
	gpio_config_t io_conf;
	io_conf.intr_type = GPIO_INTR_DISABLE;
	io_conf.mode = GPIO_MODE_OUTPUT;
	io_conf.pin_bit_mask = GPIO_BIT_MASK;
	io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
	io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
	gpio_config(&io_conf);
	
    gpio_set_level(GPIO_NUM_8, 1);	
}

Re: problem with LED

Posted: Mon Nov 04, 2024 8:16 pm
by MicroController
Try

Code: Select all

gpio_set_level(GPIO_NUM_8, 0);

Re: problem with LED

Posted: Tue Nov 05, 2024 5:54 am
by jsmith56x
Don't work

Re: problem with LED

Posted: Tue Nov 05, 2024 6:14 am
by ok-home
jsmith56x wrote:
Tue Nov 05, 2024 5:54 am
Don't work
ESP32-C3-DevKitM-1 has a rgb LED on it
IO8-GPIO8 RGB LED
https://docs.espressif.com/projects/esp ... e.html#id7
try
https://github.com/espressif/esp-idf/bl ... ple_main.c
CONFIG_BLINK_LED_STRIP

Re: problem with LED

Posted: Tue Nov 05, 2024 6:42 am
by jsmith56x
Thanks for your response

But no led_strip.h in my c:\espressif directory

Re: problem with LED

Posted: Tue Nov 05, 2024 7:07 am
by ok-home
jsmith56x wrote:
Tue Nov 05, 2024 6:42 am
But no led_strip.h in my c:\espressif directory
connect led_strip component
idf_component.yml
https://github.com/espressif/esp-idf/tr ... blink/main