I am an avid cyclist and, of course, I love this occupation very much. In our city (Krivoy Rog, Ukraine) there is a club of cyclists like me.
We decided, in the winter, to arrange a competition. But, since you can’t organize an open-air race in winter, due to weather conditions, you’ve come up with indoor competitions, on bicycles fixed in place (according to the principle of a bicycle simulator). ')
The idea was to fix the rear wheel of the bicycle in the frame, place a sensor on it that 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 bike is going, although, in fact, it stands still, cyclists only pedal.
Two cyclists would compete with each other, and the distance they travel would be projected onto the screen online and their course and speed would be seen. So this was the task and for its implementation it was necessary to write a program. I was familiar with programming only from school, at the level of Pascal from DOS.
Each bike is equipped with a wheel turn sensor from a normal speedometer, and these 4 wires go to the LPT port (only with this and could work then).
That's the whole simple implementation of a soldering iron and wires.
Then everything was more difficult. It was necessary to choose for what to program, and the choice fell on Visual C ++, later did not regret. And began the working days of learning the basics of the language, viewing other similar codes, connecting the library to work with the port LPT.
What happened can be seen in the picture.
There is no need to describe the code, it is simple and straightforward, in many respects it may not be very readable, but I only succeeded in this. And in two and a half months I could do this:
The video was displayed through the projector on the screen for all to see.