My final year university project was VR Bike, a cycling simulator. It was made up of two parts, a program showing the screen above programmed in C# utilising XNA and a USB interface I built using a Microchip PIC programmed in MPLab using C.
Skeleton code from Microchip was used to get a HID device working over USB. Code was added to this to measure times between pulses from a wheel sensor and a crank sensor. It also sent a PWM output to a servo via a second microcontroller programmed in assembly which controlled the resistance lever on a bicycle home trainer. I built all the electronics myself which was the easy part.
The main program would play a video, synchronised to a GPS recording. The riders speed would be reflected in the video playback speed and gradients would be simulated by feedback to the servo. This would increase the resistance as the hill got steeper.
I was told in my project demo that this was quite a technical achievement for an undergraduate.
Here is some of the code.
Capture.cs Form1.cs GPXParser.cs PIC18F4550.cs XMLWriter.cs
And the PIC code
pic18f4550-hardwareprofile pic18f4550-main pic16f87-main.asm
And the project write up
