Page 1 of 1

[0.12] - tank contents display

Posted: Wed Aug 12, 2015 7:28 pm
by @xi@g@me
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

Re: [0.12] - tank contents display

Posted: Wed Aug 12, 2015 8:08 pm
by @xi@g@me
Bonus - binary display.

This one is quite unreadable but wuite fun to create :P
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 :)

Re: [0.12] - tank contents display

Posted: Fri Aug 14, 2015 9:37 pm
by TuckJohn
I like this; very nice job!

Re: [0.12] - tank contents display

Posted: Sat Aug 15, 2015 1:02 pm
by @xi@g@me
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.

Re: [0.12] - tank contents display

Posted: Fri Sep 09, 2016 10:47 pm
by Kostriktor
wow guys you are geniuses !
you have machinebrains
Ill never know how to do these things, electric=magic

Re: [0.12] - tank contents display

Posted: Tue Oct 04, 2016 2:50 am
by Juggla
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!

Re: [0.12] - tank contents display

Posted: Tue Oct 04, 2016 2:21 pm
by Juggla
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?!?!?

Re: [0.12] - tank contents display

Posted: Tue Nov 15, 2016 10:46 pm
by Furcube
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.

Image

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+3ubLbVbsn7vJP61my+nj9uG+
fP6XvNjuZsvR+Pjnjj+cfBg9lc/Yrbblo8f5apH9MxVPT/v/W62Of6R80l8jMfp7+lhki/Kphw/+cJMvptF4nhfzXb7d/2O/qlyHGiOEW2tOGvOpyLJVxZzy
I3Ww52BO+NIc2dmcn2rMGUMr//y2Mgqel0rcE2GzIxbZPF9kRaMf1Hca88Tzg27Knyzy5w90mxeb7Q3qmU22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