Perhaps this binding can help. It supports the use of hardware generated pwm signals based on the internal 19.2 MHz crystal oscillator (54 MHz for Pi4B) which should be more than enough to control things like LEDs
I use it to drive a PWM fan at 25kHz, together with a CMOS to convert from 3.3V to 5V logic.
In the OH3 version the syntax for the executeCommandLine has changed, but I can’t get the parameter value to work properly.
I tried executeCommandLine(Duration.ofSeconds(10), "screen", "-S", "dimmer", "-X", "stuff", "\""+(newValue.toString)+" \\n\"")
which killed the screen and executeCommandLine(Duration.ofSeconds(10), "screen", "-S", "dimmer", "-X", "stuff", "\""+(newValue.toString),"\\n\"") which keeps the screen alive but does not impact the device (and running the command from the command-line does).
Any suggestions on how to send the ‘quoted stuff’ part of the command properly?