PDA

View Full Version : Outputting negative values from a timer



Taffey
09-24-2012, 09:20 PM
I'm sure this has been covered 5,697 times somewhere else and I am mostly an idiot but hey, if someone else has this question maybe they'll be able to find it that much easier. :p

How do you / is it possible to output a negative value from a timer? What I was trying to do (I figured out a caveman-like workaround) is use logic to make something gradually start falling away - basically just like gravity only in slow motion. A timer (set to count up) hooked into a mover (set to speed scale) does this quite nicely, but there's just one problem. You can't make things go left or down - only right or up - and this is due to the fact that a timer will only output a value of 0 to 100. Yes, you can flip over the mover and set local space to yes but that's silliness. You can tweak a battery to negative values and that works very nicely indeed with a mover, but really only on/off and not good for speed scale applications.

Before you say "use a not gate", I tried that and it doesn't work. It will only invert the value from a relative 100 and will not return negative values (or at least I can't figure out how to make it do that). In other words, if the timer is outputting 80 and you hook it into a not gate it will give you 20 instead of -80.

Any suggestions? The only other thing I can think of (but haven't tried yet) is to use an and gate, set it to multiply values, and hook it up to a battery set to -1.

JKthree
09-24-2012, 09:29 PM
I think i had something few months back when i tried making a Hot Shots Golf Power/Impact Meter. I believe I had 2 timers, one for negative value and one for positive. And for that mover On a different project i tried making, 2 microchips each that turn on based on the condition, (in your case when its positive or negative) and inside the microchips were the speed scale movers that were connected to the +/- timers.

I'll see if i can scrounge around my LBP2 moon later, or make something similiar on the Vita to upload as a pic

comphermc
09-24-2012, 09:38 PM
Wire the timer into the negative port of a direction combiner.

---
Edit - Bonus tutorial, since that was too easy:

How to make a timer's value range from -100 to +100

Why would you want to do this? I dunno. But it works...

First take your timer's output and wire it into the positive port of a direction combiner. Wire a 50% battery into the the negative port. This will make your values range from -50% to 50%. So we just need to scale everything by a factor of 2 to achieve the desired result. That's simple enough. Take the output from the direction combiner and wire it into both ports of an OR gate. Tweak the OR gate to add, and you are effectively multiplying by 2.

You are now done. :D

GribbleGrunger
09-24-2012, 09:48 PM
Wire the timer into the negative port of a direction combiner.

I don't believe it!!! My one and only chance of scoring some Browny points and I backed out of typing that. I just thought it couldn't be that simple and was worried I'd make myself look a fool. Well, I want second hand credit.

Taffey
09-24-2012, 10:34 PM
Wire the timer into the negative port of a direction combiner.Ah yes, I was hoping you'd answer the Comph Beacon. I feel like Commissioner Gordon now. :p

Thanks! I fooled around a bit with combiners and splitters but didn't try exactly that - I didn't know they would do that. I figured there was a simple solution but just didn't know what it was. ;)

On a side note, being able to wire stuff into a note and have it display the value was HUGELY useful. No guesswork at all about what was working and what wasn't.




Edit - Bonus tutorial, since that was too easy:

How to make a timer's value range from -100 to +100

Why would you want to do this? I dunno. But it works...Interesting! Hmm.. I can maybe think of times when I might need something like that. Most likely, by the time I get around to needing it I will have forgotten how to do it. ;)

evret
09-25-2012, 08:29 AM
Wire the timer into the negative port of a direction combiner.

---
Edit - Bonus tutorial, since that was too easy:

How to make a timer's value range from -100 to +100

Why would you want to do this? I dunno. But it works...

First take your timer's output and wire it into the positive port of a direction combiner. Wire a 50% battery into the the negative port. This will make your values range from -50% to 50%. So we just need to scale everything by a factor of 2 to achieve the desired result. That's simple enough. Take the output from the direction combiner and wire it into both ports of an OR gate. Tweak the OR gate to add, and you are effectively multiplying by 2.

You are now done. :D
why so complicated? :P
all you need to do is wire the timer to positive input of combiner and to a NOT gate, then wire the NOT to the negative input.

pivottt
09-25-2012, 01:25 PM
O.o Evret beats the master! :D