problem with LED

jsmith56x
Posts: 13
Joined: Sun Oct 13, 2024 2:51 pm

problem with LED

Postby jsmith56x » Mon Nov 04, 2024 4:43 pm

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);	
}

MicroController
Posts: 1725
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: problem with LED

Postby MicroController » Mon Nov 04, 2024 8:16 pm

Try

Code: Select all

gpio_set_level(GPIO_NUM_8, 0);

jsmith56x
Posts: 13
Joined: Sun Oct 13, 2024 2:51 pm

Re: problem with LED

Postby jsmith56x » Tue Nov 05, 2024 5:54 am

Don't work

User avatar
ok-home
Posts: 78
Joined: Sun May 02, 2021 7:23 pm
Location: Russia Novosibirsk
Contact:

Re: problem with LED

Postby ok-home » Tue Nov 05, 2024 6:14 am

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

jsmith56x
Posts: 13
Joined: Sun Oct 13, 2024 2:51 pm

Re: problem with LED

Postby jsmith56x » Tue Nov 05, 2024 6:42 am

Thanks for your response

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

User avatar
ok-home
Posts: 78
Joined: Sun May 02, 2021 7:23 pm
Location: Russia Novosibirsk
Contact:

Re: problem with LED

Postby ok-home » Tue Nov 05, 2024 7:07 am

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

Who is online

Users browsing this forum: No registered users and 450 guests