Logarithmic to lineair.

May 31, 2011 at 10:30am

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!

#57342
May 31, 2011 at 12:47pm

rogier

best&easiest way would be to get yourself a linear pot.
(can’t imagine rob and aart can’t provide one :)

rob

#205417
May 31, 2011 at 12:47pm

rogier

best&easiest way would be to get yourself a linear pot.
(can’t imagine rob and aart can’t provide one :)

rob

#205509
May 31, 2011 at 3:39pm

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

#205418
May 31, 2011 at 3:39pm

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

#205510
Jun 1, 2011 at 5:13am

a few ways to experiment with an [expr] curve, you can get pretty much anything you want with enough tweaking :)

– Pasted Max Patch, click to expand. –
#205420
Jun 1, 2011 at 5:13am

a few ways to experiment with an [expr] curve, you can get pretty much anything you want with enough tweaking :)

– Pasted Max Patch, click to expand. –
#205511

You must be logged in to reply to this topic.