## [0.12] - tank contents display

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art , computers.
@xi@g@me
Inserter
Posts: 30
Joined: Wed Jan 28, 2015 6:03 pm
Contact:

### [0.12] - tank contents display

This time, a more useful thing than the micro machines track

Following a bet, I did some experiment and managed to create a percentage counter telling how much petroleum gas is in the storage
First image was an initial try, with 2 lines, one showing the tens, and one the units

Here it displays 31%
Display 2 lines
The second is a bit more advanced (the bet goal) and show the percentage with 2 floating point digits precision using "7-segment" displays
Display percentage
What you see on top of the images are the deciders I use to compute each digit from 0 to 9. This is easily done by dividing and multipling again, so with precision loss you can get what has been removed from the initial number.
For exemple if you want the tens and units of "27", you can divide 27 by ten, and then multiply by ten. You get : 27 / 10 = 2, and 2 * 10 = 20. And then 27 - 20 gives you seven.
This technique is also used for the 2 lines display.

After that, the two first lines of deciders are just to see if the digit equals 0, 1, 2, etc. when the digit equals the desired value, 1 is outputed.

The third and fourth lines are series of constant units, otuput signals of type 1 to D, needed to turn the lights we want on to create the desired number.
Normally I would need only a single array of constant units, but the red cables were to short to connect them everywhere. So instead of putting 10 eletric poles in the middle, I just doubbled the layout, it's more presentable

The last lines are multiplier units. I use them to multiply each output of the constant units with the output of the first line with the output of the "=" deciders. This gives a logical "and" behavior.

And after that, each output is connected to the lights, and each light is programmed to light if the desired signal is received (1 to D)

P.S. the spoilers frames cut the images, do right click + show image to see the full image

@xi@g@me
Inserter
Posts: 30
Joined: Wed Jan 28, 2015 6:03 pm
Contact:

### Re: [0.12] - tank contents display

Bonus - binary display.

This one is quite unreadable but wuite fun to create
Binary display
From left to right, high weight bit (64) to low weight bit (1). Here we see 99 (64 + 32 + 2 + 1)

The system is the same system used to compute tens and units, but this time we divide/multiply by 2

TuckJohn
Filter Inserter
Posts: 335
Joined: Sat Jul 04, 2015 4:11 pm
Contact:

### Re: [0.12] - tank contents display

I like this; very nice job!
~1200+ hours clocked in factorio. Avid KSP and Factorio player

@xi@g@me
Inserter
Posts: 30
Joined: Wed Jan 28, 2015 6:03 pm
Contact:

### Re: [0.12] - tank contents display

Thanks TuckJohn

I'm currently working on it to do some changes in the behavior (blinks when %age is under 15) and to optimize the number of used combinators.

Kostriktor
Inserter
Posts: 41
Joined: Sun Aug 21, 2016 12:58 pm
Contact:

### Re: [0.12] - tank contents display

wow guys you are geniuses !
you have machinebrains
Ill never know how to do these things, electric=magic

Juggla
Inserter
Posts: 27
Joined: Tue Apr 19, 2016 11:22 pm
Contact:

### Re: [0.12] - tank contents display

This is so much more accurate than mine
I may have to steal some of these ideas and implement them into my setup.
Good Job and thanks!

Juggla
Inserter
Posts: 27
Joined: Tue Apr 19, 2016 11:22 pm
Contact:

### Re: [0.12] - tank contents display

OK after some tinkering I'm a bit confused ... I see how you displayed the percentage and it makes sense and I can replicate it. What I can't figure out is how you calculated the percent without additional combinators. The only way I can come up with is to use another combinator - First you take the total number of tanks and multiply by 25 let's say this equals "x". Then set a combinator to Fluid / x = actual percent of fluid in the tanks. Except this doesn't come up with the decimal. So , Am I missing something?!?!?

Furcube
Burner Inserter
Posts: 12
Joined: Tue Nov 15, 2016 10:22 pm
Contact:

### Re: [0.12] - tank contents display

To display decimals you need to calculate like this: oil * 100 and then / 25. and you'll get for example 8536 for 85.36%

I started with op's solution, then optimized display logic and added some functions. For example my version will change color to yellow when value is below 50% and then to red when below 30%. I didn't like numbers flickering so fast so I added memory cell which will update value each 60 ticks.

1 - pulse generator
2 - memory cell
3 - x mod y
4 - colors logic. It is primitive and will output several colors at once, but it is working just fine as red will override yellow.

Blueprint string

Code: Select all

``````H4sIAAAAAAAA/+1dXW/jthL9Kws/Xti9IinqA60LdPv12oc+bVEEXlvZFeDYgWzvbRDkv1/Zzm6joTQ+lExbjPK4m1DxzJkzczgcyov1u+V6Plu+u5k+Zqtt
vs2zzfTxcTW7y6aj+Xq12c5W28l8ffcxX82262I0vl9vyt9ar6aP/0zj8cN0IqKn8SIvsvnhf8NxuWpbrJc3H7PPsy/5upg+3ub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