I assume the tracks are AC, there's a rectifier in the car (#4 you see the 4 diodes) and the motors are DC.
I'd use a standard rc car ESC with BEC for 3S or 4S, depending on the DC voltage available after the rectifier. (There are ESCs for DC motors without aluminum cooling block and fan). These ESCs have the PWM already build in, so no need to build your own PWM software and hardware.
Then just modify your board to work with the CR2031 as backup to avoid resets, and power it from the 5V BEC.
To control the ESC:
const servoPin = <pin>
let servoPosition = 1.5; //1500ms == centered; 1000ms == min; 2000ms==max;
//at 1000 you'll go backwards at max speed, at 2000 forward at max speed
pinMode(servoPin , "output");
setInterval(function() { digitalPulse(servoPin , 1, servoPosition ); }, 20);
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 assume the tracks are AC, there's a rectifier in the car (#4 you see the 4 diodes) and the motors are DC.
I'd use a standard rc car ESC with BEC for 3S or 4S, depending on the DC voltage available after the rectifier. (There are ESCs for DC motors without aluminum cooling block and fan). These ESCs have the PWM already build in, so no need to build your own PWM software and hardware.
Then just modify your board to work with the CR2031 as backup to avoid resets, and power it from the 5V BEC.
To control the ESC: