Hi,
I haven't looked at your code but remember that the pins can source and sink 25mA. This is probably enough for direct driving the segments but if you have 10mA thru each segment and all seven segments lit up the poor pin on PortB that is trying to sink 70mA is going to have a hard time.
Otherwise your aproach is correct, called multiplexing. Since each digit is only "on" 1/3 of the time (or less) it's quite common to drive the segments harder than their continous rating to get more light out of them. That way the average current thru the segments is still kept below their rating.
/Henrik.
Bookmarks