View Full Version : Math Question
737NUT
02-12-2012, 10:44 PM
I have a unique problem I need to solve via math. As I turn a potentiometer it's output goes from 179 to 0, what I need is a math formula that changes that to a 181 to 360 Is that even possible??
Thanks
Rob
deering
02-12-2012, 11:39 PM
Output = 360 - Input
jonesthesoftware
02-13-2012, 07:09 AM
Hi Rob
not sure which way round you want it but
converted value=(1-potvalue)+360
so at
pot 0 1-0+360= converted value of 360
pot 179 1-179+360=converted value of +182
or the other way round is
converted value = 360-potvalue
so
pot at 179 360-179 =converted value of+181
pot at 360 360-1 = converted value of 360
I use 1, don't use 0 as computers crash if you try to subtract from 0
hope this is what you wanted
kind regards
geoff
737NUT
02-13-2012, 09:56 AM
Thanks, I figured it out just before bed last night. Take the input times -1 then add 360 That is a programmable formula with no need for tables. ;)
Rob