What should a cyclist do in winter?

Good afternoon.

I am an avid cyclist and, of course, I really love this activity. In our city (Kryvyi Rih, Ukraine) there is a club of cycling lovers like me.

We decided, in the winter, to arrange competitions. But, since you can’t organize outdoor races in the winter, due to weather conditions, we decided to make competitions indoors, on bicycles fixed in place (on the basis of a bicycle simulator).

The idea was to fix the rear wheel of the bicycle in the frame, place a sensor on it, which would read the number of wheel revolutions per second and transmit commands through the LPT port to the computer. Thus, it would be possible to see how fast the bicycle rides, although, in fact, it stands still, cyclists only pedal.

Two cyclists would compete with each other, and the distance they drive would be projected onto the screen online and their course and speed would be visible. That such a task was set and for its implementation it was necessary to write a program.

I was familiar with programming only at school, at the Pascal level of DOS.

A wheel revolution sensor from an ordinary speedometer is installed on each bike, and these 4 wires go to the LPT port (I only knew how to work with this then).

image

That's the whole simple implementation of a soldering iron and wires.

image

Further everything was more difficult. It was necessary to choose what to program under, and the choice fell on Visual C ++, and later did not regret it. And weekdays began to learn the basics of the language, view other similar codes, connect the library to work with the LPT port.

What happened is visible in the picture.

image

There is no need to specifically describe the code, it is simple and unpretentious, in many ways it may not be very readable, but I only succeeded. And in two and a half months I could do this:




Video was output through the projector to the screen for public viewing.

Also popular now: