Logarithmic to lineair.
Hi guys,
my mathematical skills aren't that great, so I'm hoping some one can help me with the following problem.
I've connected a potentiometer to an arduino, and it returns values between 0 and 1024.
The problem is that it doesn't output these values on a lineair scale, but rather in a logarithmic way.
So I'm wondering, is there anyway to correct this?
To convert log to lin?
Any help in the right direction would help me and my colleagues a bunch.
Thanks!
rogier
best&easiest way would be to get yourself a linear pot.
(can't imagine rob and aart can't provide one :)
rob
Hey there,
In case changing the pot is not an option for some reason, I would try to use lp.scampi or lp.scampf from the excellent—and free—Litter Power collection of externals. Arguments would have to be something like [lp.scampf map 0. 1024. 0. 1024. pow -1], I guess, but maybe Peter can chime in in case I am wrong.
Vary the '-1' until you get the output curve you'd like.
You'll find the objects here:
http://www.bek.no/~pcastine/Litter/
Good luck!
Klaas-Jan
a few ways to experiment with an [expr] curve, you can get pretty much anything you want with enough tweaking :)