I'm not 100% sure on the highest frequency, but I believe it is over 1MHz.
My guess is that based on Espruino's execution speed, your code might struggle to run at 1KHz.
You can definitely do a bit better with software if you need to (using setInterval and digitalPulse) but for things like PWM using the hardware wherever possible is preferable.
The reason why I'm not using setInterval is because it would work for LED's but when I tried using it with a toy motor, it would turn on but not off... setTimeout works for the motor and LED's so I've just been using that
In case it's not obvious, lol, I'm super new and just learning as I go.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'm not 100% sure on the highest frequency, but I believe it is over 1MHz.
My guess is that based on Espruino's execution speed, your code might struggle to run at 1KHz.
You can definitely do a bit better with software if you need to (using
setInterval
anddigitalPulse
) but for things like PWM using the hardware wherever possible is preferable.