Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By unsignedchar
#43892 This should work:

1 - Set your port pin to GPIO mode, just as if you wanted to use it as normal output.
2 - Get the #defines from the include file I've attached.
3 - Use the code below

pin_number is in range 0...15.
value is one of the empirical values from one of my previous posts.
I never tried to fully understand how the PWM values work.

Code: Select alluint32 pinaddr = GPIO_PIN_ADDR(GPIO_ID_PIN(pin_number));
GPIO_REG_WRITE(pinaddr, GPIO_REG_READ(pinaddr) | 1);
GPIO_REG_WRITE(GPIO_SIGMA_DELTA, pwm_value);



I've also attached my full relay driver source file. That's most likely not gonna compile outside of my project, but could have some use as an example anyway.
You do not have the required permissions to view the files attached to this post.