How we coupled product innovation with mass manufacturing
medium.com
medium.com
Its about 300 lines for the projector management class, with some internal state machine logic, and a number of draw calls using pygame.draw.circle(). Calibration offsets are stored in a config file to allow for variations between each physical device made up.
Using a python thread to make the draw calls can occasionally go wrong and the Banana Pi gets stuck, but that's sufficiently rare enough that you can just reboot to solve the issue in the factory.