[Andrea] was helping out a local rally racing team with their car and was asked to create a device that would display the current gear on a big, bright display. Of course, a device like this already exists, but the team didn’t want to invest the significant resources into a ready-made product. Instead, [Andrea] was tasked with creating one.
The device is basically a pot attached to the gear shifter, but in testing, [Andrea] ran into a problem; between reverse and 5th gear, the shifter would turn 360 degrees, meaning these gears were indistinguishable.
The solution to this problem was a calibration procedure for when the driver starts the car. By setting a jumper, the driver puts the car into all gears, sorting out the reading and storing the analog values in the microcontroller’s EEPROM.