This was a long time ago, but I wired up a photometer (counts photons) to an Apple 2 joystick port, then wrote a tight 6502 assembler timed loop that would count pulses on the joystick button input. It would accurately read over 50,000 button presses per second, which was good enough to do variable star photometry. I also wrote an applesoft basic program that assisted in the process of variable star photometry and used the assembler routine to read values from the photometer. By connecting the photometer to a telescope and following directions of where to aim the telescope given by the software, it could be used to observe and graph brightness of variable stars over time. Also could be used to calculate the angular velocity of asteroids. This was is the days before extrasolar planets were found, but similar in principle to how that is done. Though the objects we were looking at were orders of magnitude brighter than the brightness fluctuations observed to find planets.