Okay. This is the hardest part of the entire build. Feel free to skip this on your first build, or improve it and let me know!

I got these great LED bars I want to use as fuel gauges. The top LED is blue, then some green, then orange and finally red. If we can light one LED at a time, we can let it represent the fuel level on our spacecraft.

I initially ordered driver IC's with them. They work great! You can select dot mode or bar mode and it will display an analogue input voltage as a single LED (dot) or a range of LEDs (bar). But an Arduino does not output an analogue voltage! And the PWM feature that allows you to dim a LED by sort of emulating an analogue voltage, does not work with these driver IC's.

On to plan 2: shift registers. You get to work with these in every Arduino starter kit. And you can learn more about them here: https://www.arduino.cc/en/Tutorial/ShiftOut

The plan is to somehow convert the fuel levels into the proper string of bits that will represent the fuel levels on the LED bars. With 5 fuel gauges, all fuel levels filled up would need to be 10000000001000000000100000000010000000001000000000. With monopropellant empty, it would become: 10000000001000000000100000000010000000000000000001.

Sound simple enough. There are some complications. The shift registers have 8 pins, while the LED bars have 10 LEDs. I use 7 shift registers to get 56 outputs. When wiring them in, I skipped an IC pin somewhere (we'll fit that in code). And I wiring one LED bar in starting at the other end (we'll fix that in code). Oh and Arduino math that we need sometimes uses floating point arithmetic which causes rounding errors (we'll fix that in code). Note that I share the code in a later step.

My final build did not match the attached wiring diagram, so if you rebuild this controller, some updates are required to the code. Comment below if you need assistance.

Every LED requires it's own resistor. Try some different values in order to match the brightness. Green appears much brighter than red with the same resistors, so it helps to balance that out.

End result: instead of 50 digital pins required to power the 5 LED bars, that is reduced to 3: a clock signal, a latch signal and a data signal.