The motors are driven by a DRV8833 dual H-bridge circuit. The principle of such a control is pretty simple, the H – bridge hold one terminal of the motor to ground while the other is set to Vdrive. For the reverse direction it’s just the other way round.
The bridge is controlled by two inputs for both side of the bridge and if they haven’t the same state the motor turns in one or the other direction. You’ll find a very detailed explanation about here: http://www.modularcircuits.com/blog/articles/h-bridge-secrets/h-bridges-the-basics/.
To control the speed of the motor a PWM signal is applied to one input while the other input is hold to LOW. A PWM signal is what is generated with the Arduino when the analogWrite() procedure is used. In the current stage the Arduino IDE for the ESP32 can’t do such a analogWrite() procedure not yet exactly, a espressif call is required therefore – this is why the drive on github is still in development state, but it has been promised that even a much more accurate driver function will come. – For an analog output the ESP32 would have even to DAC for a real analog value but they can’t be used with the H-bridges.
Theoretical it would be also possible to keep one input of the bridge on a HIGH state instead of a LOW state while applying a PWM signal on the other input. This would change the turn direction and changing the control from fast to slow instead from slow to fast but would work as well. In the same way? Not in the same way exactly as the datasheet of Ti shows:
The table shows that in this case “slow decay” instead of “fast decay” will be applied. The difference between those two modes is that the terminals of the motor are either shortened or open while the not powered phase of the PWM cycle.
This means with “Fast decay” the robot is just free rolling while there isn’t power on the motor while it does kind of break speed depended in the “Slow decay” mode. This has no impact on the top speed only the movement should be more accurate and the way to stop should be shorter. The last should be of relevance for this robot platform. This as the max speed is that high that it needs to be reduced pretty much when realizing a line follower. The “Slow decay” mode should help to increase its reactivity for such an application.