Enabling 25kHz pwm on SparkFun Thing Plus

Hi,

I want to control 12V fan speed using pwm which works on 25kHz.

In Arduino Nano i used the following to code to configure PWM as 25kHz:

  /*
   // Configure Timer 1 for PWM @ 25 kHz.
    TCCR1A = 0;           // undo the configuration done by...
    TCCR1B = 0;           // ...the Arduino core library
    TCNT1  = 0;           // reset timer
    TCCR1A = _BV(COM1A1)  // non-inverted PWM on ch. A
           | _BV(COM1B1)  // same on ch; B
           | _BV(WGM11);  // mode 10: ph. correct PWM, TOP = ICR1
    TCCR1B = _BV(WGM13)   // ditto
           | _BV(CS10);   // prescaler = 1
    ICR1   = 320;         // TOP = 320
*/

How can I do the same in SparkFun Thing Plus?

Thanks.

This https://randomnerdtutorials.com/esp32-pwm-arduino-ide/ has a pretty good explanation, as does https://arduino.stackexchange.com/quest … p-wroom-32 for using PWM on esp32…please note that 12v will need to be stepped down for use w/ the 3.3v onboard the Thing Plus

There are many examples out there, poke around a bit to see similar projects in action