micropython
micropython copied to clipboard
Set PWM frequency to 10kHz
Hi, I wanna set the pwm frequency to 10kHz, but the minimum value for set_analog_period_microseconds is 256us which results in 3.91kHz. I can set to 10kHz in makecode. Is there any other way for me to set the pwm frequency to 10kHz ?
Yes with arm thumb 2 assembly see this repository https://github.com/rhubarbdog/microbit-assembly for some example code. The examples are mainly for version 2 microbial. Be careful with high frequencies from 30khz dogs are affected at 50khz rats and mice will be attracted