The program works, however, the code hasn't been cleaned up as yet, since I'm still tweaking the program.
The basic principle is that the Universal 2Pin Treadmill Speed Sensor Magnetic Sensor triggers an interrupt whenever it detects the magnetic field of a magnet on the flywheel.
(In my case, i've used the existing flywheel magnet on my Reebok Jet 100+ treadmill.)
The interrupt records the time between rotations to calculate the flywheel RPM. The belt speed and distance traveled are then calculated and displayed on the ESP32 webpage.
This software can be adapted to any treadmill by setting the belt_distance variable, which is the circumference of the flywheel and treadmill belt. (Distance traveled between interrupts)
A basic solution could just read the rpm and send the current speed over bluetooth.
This project displays the speed(kph), distance(meters), uptime, bluetooth kph speed upshift speed, current rpm, total revolution count.
Webpage UP/Down buttons are used to vary the bluetooth kph speed. (which is the sum of the treadmill belt speed and the manually adjusted speed.
The Reset button can be used to reset all counters.