uint32 pwm_duty_init[PWM_CHANNEL] = {0,0,0};
for 3 channels didn't help.
Explore... Chat... Share...
uint32 pwm_duty_init[PWM_CHANNEL] = {0,0,0};
eriksl wrote:Also you might want to try this:Code: Select alluint32 io_info[][3] = {{PWM_0_OUT_IO_MUX,PWM_0_OUT_IO_FUNC,PWM_0_OUT_IO_NUM},{PWM_1_OUT_IO_MUX,PWM_1_OUT_IO_FUNC,PWM_1_OUT_IO_NUM},{PWM_2_OUT_IO_MUX,PWM_2_OUT_IO_FUNC,PWM_2_OUT_IO_NUM}};
change to this:Code: Select alluint32 io_info[PWM_CHANNEL][3] = {{PWM_0_OUT_IO_MUX,PWM_0_OUT_IO_FUNC,PWM_0_OUT_IO_NUM},{PWM_1_OUT_IO_MUX,PWM_1_OUT_IO_FUNC,PWM_1_OUT_IO_NUM},{PWM_2_OUT_IO_MUX,PWM_2_OUT_IO_FUNC,PWM_2_OUT_IO_NUM}};
So you're sure that the io_info array is exactly as large as the pwm_init function expects. This is just like #define usage, help the compiler help you by not trusting on "easy" default behaviour.
limpkin wrote:Anyway, I already tried with 1 and 2 pwm channels... no success.
LOCAL uint32 duty = 500;
LOCAL uint32 io_info[][3] = {{PERIPHS_IO_MUX_MTCK_U, FUNC_GPIO13, 13}};
LOCAL void ICACHE_FLASH_ATTR config_PWM(void) {
pwm_init(1000, &duty, 1, io_info);
pwm_start();
}
rabbit wrote:limpkin wrote:Anyway, I already tried with 1 and 2 pwm channels... no success.
Did you solve your problem?
My PWM-test with GPIO13 (1 channel) works with sdk1.3.0:Code: Select allLOCAL uint32 duty = 500;
LOCAL uint32 io_info[][3] = {{PERIPHS_IO_MUX_MTCK_U, FUNC_GPIO13, 13}};
LOCAL void ICACHE_FLASH_ATTR config_PWM(void) {
pwm_init(1000, &duty, 1, io_info);
pwm_start();
}
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]