Possible to use LEDC Fade along with GPIO_SET_LEVEL() on the same PIN
Posted: Wed Oct 09, 2024 6:36 pm
I'm working on some code and can't seem to figure out how to get these two functions to work together.
I have a LED on GPIO_25
I have the ledc fade code working and can get the fades to happen as I want.
I have a component that was wrote that takes a GPIO pin number and blinks a LED using gpio_set_level().
When I try to use them together the Fade will work if I initialize its code last and the GPIO_set_level() does nothing.
Then vise versa if I set the GPIO direction last then the GPIO_set_level() will work but the fade does not.
I thought I wasn't able to get them to both work because I needed to use ledc_stop() so I added it when I'm not needing to fade and still gpio_set_level() does nothing.
Then it got me to thinking how based on the order I initialize them dictates which one works, So this must be a more complex issue.
So is it the fact that they are setup a certain way and one over writes the other on initialization is my issue? Would I need to uninstall the LEDC and reinstall when I need it?
I have a LED on GPIO_25
I have the ledc fade code working and can get the fades to happen as I want.
I have a component that was wrote that takes a GPIO pin number and blinks a LED using gpio_set_level().
When I try to use them together the Fade will work if I initialize its code last and the GPIO_set_level() does nothing.
Then vise versa if I set the GPIO direction last then the GPIO_set_level() will work but the fade does not.
I thought I wasn't able to get them to both work because I needed to use ledc_stop() so I added it when I'm not needing to fade and still gpio_set_level() does nothing.
Then it got me to thinking how based on the order I initialize them dictates which one works, So this must be a more complex issue.
So is it the fact that they are setup a certain way and one over writes the other on initialization is my issue? Would I need to uninstall the LEDC and reinstall when I need it?