shaneshane1 said:
Yup. You need 7 pins to switch the segments (8 if you want DP) of
all the digits, and also one pin per digit to power the common cathode or anode. Since the CC or CA handle the current from all segments you should use a transistor on each digit to switch the current.
The digits get switched on and off in sequence, very quickly so only one is on at a time. Very quickly so the eye is fooled into thinking they're all on at once. It's called persistence of vision. Switch them too slowly and you get flicker. It's how movies work. They're just a series of still pics, but flash through them at 24-30 frames/second (or better) and it becomes motion.
Your code has to do some stuff to make sure the correct segments are lit as each digit gets enabled. Timer interrupts are your friend here. A timer counts up on its own, allowing your code to continue as normal. When the timer rolls over (this happens many times a second) an interrupt service routine is called that does the stuff to display the next digit.
I know it's not the most coherent explanation, but I'm gradually editing it till it gets clearer.
Once you learn multiplexing you can do stuff like
**broken link removed**. That 3x3x3 cube takes 12 pins to control. It's like 3 digits of 9 segments each, only not arranged in numeral shape, and with the digits stacked on top of each other instead of laid out side by side
. Took me a few evenings to get the code written, debugged and fine tuned.
Whether a Picaxe has the speed to do proper multiplexing I just don't know. I suspect it might, but possibly not. If not, you'd have to use outboard chip(s) to do it. **broken link removed** kit uses the very cheap and easy to use CD4022 chip to do its multiplexing rather than have the processor handle it. Takes only two MCU pins to control it. You could pick up one or two of those and play with em. Download the Dragonfly assembly instructions for a nice clear schematic of how to do multiple 7-segs. If you don't use the 4022, just imagine those wires from the transistor bases connecting to your Picaxe instead of to the 4022 chip. Nothing else changes.
The Dragonfly uses common cathode displays. If you're using common anode displays you'll have to use different transistors (PNP) and wire to 5V instead of ground.