Closed CloudHead84 closed 1 year ago
Great contribution. Thank you! Just one final request: convert your file to use spaces instead of tabs. This works better with the alignment of things and makes the code more readable.
Also, at the init_pwm function, it would be wise to disable the PWM pins from all IO masks, not only the analog out. Since the ESP32 has 8 PWM capable pins and only 2 pins marked as analog out on OpenPLC, this could result in conflict later with the pin being used as a digital input or something else, and being used by the PWM_CONTROLLER at the same time
Thank you! This is perfect
Added 8 possible PWM pins for the PWM_CONTROLLER function block.
Tested on a ESP32 WROOM (devkit v1) board.
All eight pwm channels tested in parallel with different frequencys. Output check via Osziloscope.