ESP32 buzzer with port expander

I have a board that has a buzzer connected through port expander and I want to be able to play some basic melodies. I'm able to generate sounds using mcp.Write High and Low but none of the most convenient libs work because ESP does not have tone function but uses ledcAttachPin which does not work with port expanders.
The only alternative to tone I found is note in Technoblogy - A Lightweight Alternative to tone but DDRB is not available on ESP32.
Does anybody know of any solution?
Thank you,
Adrian

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.