November 24, 2024, 01:16:23 PM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Inverting a range?

Started by steveo, March 10, 2008, 12:01:35 PM

Previous topic - Next topic

steveo

Jon,
If I have a variable that outputs a range, say 60 descending to 1. But I need to use that value inverse, so the 60 to 1 range is equal to 195 to 255.

The value comes from the ping sensor, so this is being generated in real time.

Is there an operation that will do this? If not, how would you do it?

JonnyMac

The answer is deceptively simple:
 
  newVal = 256 - oldVal
Jon McPhalen
EFX-TEK Hollywood Office

steveo

My brain just feels very embarrassed right now. And it should be.