About Bicycle Controller

Around this time I was supposed to have another internship, however due to the COVID-19 pandemic I had a tough time finding one. Eventually I could be part of the school’s internal project between two third year mechatronics students and a handful of second year game developer students.

The project was a home trainer hooked up with sensors controlled by an Arduino. This data would be sent via USB to the target PC. My task was to figure out a protocol between the USB and C#. Due to my previous experience with figuring out custom protocols with Pillar Games this went very smoothly.

All work was done from home, which presented various challenges. First of all: I never got to see the physical bicycle and I never had to interact with a physical USB. I used a virtual modem called “com0com” to emulate fake USB ports so I could test the program. This eventually caused inconsistencies, especially with the baud rate.

After a couple of weeks of back-and-forth discussion and debugging, we had a well-documented protocol and I had written a suite of tools for visualizing and debugging various components. The tools include:

  • Faking randomized output.
  • Basic and verbose logging to either a file or the console.
  • Live parser that displays incoming values.
  • Visualizer built in Unity.