-->
Page 1 of 3

how to drive onboard red and blue leds on ESP-01 ?

PostPosted: Fri Dec 26, 2014 4:36 am
by picpic020960
Bonjour
Not found with search function.
Hard coded and not possible ?

(Not found schematics for ESP-01 device)

With C directly , AT firmware or LUA firmware if possible

Thanks

Re: how to drive onboard red and blue leds on ESP-01 ?

PostPosted: Fri Dec 26, 2014 8:57 am
by martinayotte
The RED Led is connected to Power, while the BLUE Led is connected to TX.
So, you can not control those leds. You still can use some other GPIOs...

Re: how to drive onboard red and blue leds on ESP-01 ?

PostPosted: Fri Dec 26, 2014 10:09 am
by gerardwr
martinayotte wrote:The RED Led is connected to Power, while the BLUE Led is connected to TX.
So, you can not control those leds. You still can use some other GPIOs...


You CAN control the blue LED if you do not need the TX function. TX is actually GPIO1 so by setting GPIO1 to HIGH it will light up. Ofcourse sending output to serial will spoil things.

BTW : RX=GPIO3.

Re: how to drive onboard red and blue leds on ESP-01 ?

PostPosted: Fri Dec 26, 2014 10:14 am
by igrr
... and here is how you could do it in C code:

Code: Select allint pin = 1;  //GPIO1
PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_GPIO1); //use pin as GPIO1 instead of UART TXD
gpio_output_set(0, 0, 1 << pin, 0); // enable pin as output

...

gpio_output_set(1 << pin, 0, 0, 0); // set pin high

...

gpio_output_set(0, 1 << pin, 0, 0); // set pin low