code to drive a generic multiplexed 7-segment display (an old LED bubble display in particular)