@ mods, admins: I hope this post suits in the category "Circuits and Projects / The Projects Forum". If not, feel free to move it elsewhere.

My name is Gregor and I am a total newbie in electronics.

I have a micro-controller-board with 14 digital outputs (outputs with either the value 0 Volt („0“) or 5 Volt („1“) ). I want to implement a visualization of the value of a board-variable with 10 LEDs in the following way:

If the value of the variable is '0', no LED should be on.

If the value of the variable is '1', the first LED should be on

If the value of the variable is '2', the second LED (or the first two LEDs) should be on.

If the value of the variable is '3', the third LED (or the first three LEDs) should be on.

......

.....

If the value of the variable is '10', all LEDs should be on.

A trivial solution, which I thought of, is to plug the 10 LEDs to 10 of the 14 digital outputs. The problem, however, is that in that case only four unused digital outputs remain.

Now, my idea is to use just 4 digital outputs, which should represent digits of a four digit binary number, which encode the (decimal) variable value as a binary number, which in turn determines which LED (or LEDs) should be on e.g. if the variable has the (decimal) value '6', which corresponds to the binary value '0110', then the output value of the second and third digital output should be „1“ (5 Volt) and at the output value of the first and fourth digital output should be „0“ (0 Volt). And now (in this case), since the output values of the four digital outputs represent the (decimal) variable value '6', the sixth LED (or the first six LEDs) should be on.

So far I have found out, that this could be implemented with an electrical network based on bipolar transistors, which should be used to build logical AND-, OR- and NOT-gates, but I have no idea how this can be done in detail.

I have the following prior knowledge:

*) I know that current is flowing from a source to a ground.

*) I know what an electrical resistance and a bipolar transistor are, how they work and how their corresponding symbols in a circuit diagram look like.

*) I know what a AND-, OR- and NOT-gate is.

*) I have basic skills in programming my micro-controller-board, in particular I know how to write to its digital outputs.

Further prior knowledge I don't have. I am, of course, thankful for any replies, but those wich would require additional knowledge / skills will, unfortunately, be of little help for my. In particular I can't estimate, what I will have to consider regarding voltage and current intensity. So I don't now, what to do to be be sure, that no transistor or the board itself gets damaged.

An additional circuit diagram, or a photo of a drawing of a circuit diagram, would be very(!) helpful.

I hope I have communicated my request as clear and unmistakable as possible, so that helping me can be achieved with the smallest time exposure as possible.

Thanks in advance for any replies!

Gregor