Percentage Monitor (Funky Trees Challenge)
Behold!! The most customizable 7 segment display in SimplePlanes!
that doesn't mean its the best tho
low part count!!
Desc for lame boring ppl who dont read descs and dont care about them
Measures a 0-1 value as a percentage. To change the input, change wherever you see Throttle to the input you want. To add another digit, add it as a subassembly of the previous digit to the end, make sure there is no weird connections (just the baseplate connection), and divide the input (throttle) by 10 in each instance). Feel free to use in your builds and hope you enjoy!
How it Works
The first thing you will notice is the simple 7 pistons operating the thing. This allows for a low part count and can be scaled to any size (NOTE the length width and height must remain same) using relative scale or normal scale. Make sure, however, to deselect the "Scale only selected parts" feature bcz it'll screw up
The pistons have a complex funky tree resembling something like this:
clamp01(1000(sin((Throttle * 10)360 + 71) - 0.945)) + clamp01(1000(sin((Throttle * 10 - 0.2)360 + 71) - 0.945)) + clamp01(1000(sin((Throttle * 10 - 0.3)360 + 71) - 0.945)) + clamp01(1000(sin((Throttle * 10 - 0.5)360 + 71) - 0.945)) + clamp01(1000(sin((Throttle * 10 - 0.6)360 + 71) - 0.945)) + clamp01(1000(sin((Throttle * 10 - 0.7)360 + 71) - 0.945)) + clamp01(1000(sin((Throttle * 10 - 0.8)360 + 71) - 0.945)) + clamp01(1000(sin((Throttle * 10 - 0.9)360 + 71) - 0.945))
which is an absolute monstrosity. Lets try to simplify it down.
Each tree is a sum of a bunch of similar units like this:
clamp01(1000*(sin((Throttle * 10 - 0.2)*360 + 71) - 0.945))
Each "unit" represents one "blink" of a segment. For example, this one signifies that the top segment (segment 1) should be lit when the screen is displaying a 2. Lets take apart the components that make this happen.
The "meat" of the unit is the sine wave equation, which we can simplify down to sin(X + 71) - 0.945. It seems very random at first, but the special thing about this curve is that it is above the X axis almost exactly 1/10 of the time , from y ~0 to y ~36. I haven't taken calc yet and dont know if there is a way to find the exact equation for this wave. This results in some errors especially around integer numbers (if the input is very close to an integer) . For example, when you first launch it you will see it displays an 8 instead of a 0, but if you notch the throttle up to something like 0.005 (halfway between 0 and 1 %) you will see the correct 0. This means this does not work as an ammo counter as ammo counts will always be integers. Also note that the sine wave is set to a base ten automatically. Therefore you cannot count in other bases. That means it can make a timer in seconds/milliseconds but not minutes or hours because those are in base six.
This sine portion does not have a lot of customisation so just keep it the same.
The second portion is the portion that looks like
(Throttle * 10 - 0.2)*360
This portion of the tree is where the customisation is.
Lets break it down a bit further.
(input * multiplier * factor - count) * 360
(Note that multiplier
is not included in this code. This is because the multiplier is 1 in this case)
What these mean:
Input:
Any ANALOG funky tree input. Throttle is currently used. Conditionals and integers (i.e. ammo or any value using clamp01 as a conditional like this one does)
Multiplier:
The monitor is currently only set up to read values that go from 0 to 1. Turn a value such as Latitude to function with this by dividing by a much larger value, depending on your need for range. This may take some expirementing to figure out what is best suited for your needs.
Factor:
IMPORTANT: This is how you add more digits If you want to add a smaller decimal digit to the right, multiply the factor by 10. Adding a bigger digit to the left, divide the factor by 10. This factor and the multiplier work by reducing or extending the frequency of the sine wave, making it activate at different lengths of time.
360:
Dont change this. It sets the sine wave so that it can complete
Count:
Don't changes this. It moves the sine wave along the x so that the piston is activated at the right value.
clamp01(1000x
This is the conditional, I created the conditional before if/else loops were added so that's just how it is, outputs "boolean" value of whether or not it is above x axis.
Finally, there are millions of trillions of these little segments that will make your brain rot from the inside. Make sure you have the right code before putting them into everything, and double check to make sure everything is in! You probably missed one out of the millions and trillions!
plz tag me in the comments if you have questions or inquires or want a funky tree for you to copy into your build, i would love to help!
Good luck and have fun!
Specifications
General Characteristics
- Predecessor Funky Trees Challenge
- Created On Windows
- Wingspan 4.9ft (1.5m)
- Length 4.9ft (1.5m)
- Height 6.2ft (1.9m)
- Empty Weight 110lbs (49kg)
- Loaded Weight 110lbs (49kg)
Performance
- Wing Loading N/A
- Wing Area 0.0ft2 (0.0m2)
- Drag Points 784
Parts
- Number of Parts 39
- Control Surfaces 0
- Performance Cost 212
Cool! I'll try it out later!