We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpElectronics,  Serial Library › Soft Potentiometer and fixed values
Page Index Toggle Pages: 1
Soft Potentiometer and fixed values (Read 850 times)
Soft Potentiometer and fixed values
Apr 26th, 2009, 10:12am
 
Hi there, I am using a soft potentiometer to drive graphics in Processing.  It's running through a Diecimilla.  I need to figure out a way to get the soft pot to generate fixed values.  Whenever you remove the actuator (a finger in this case) from the surface of the pot the values default to a base value.  I need to devise a method to programmatically (in Processing) assign a constant value to the variable tied to the soft pot so it holds a value unless there is input.

I'm fairly certain this is a fairly generic piece of code if anyone can point me in the right direction I'd be grateful.

I would post the code I've attempted so far but it is not working at all and basically useless.

I know roughly that I need to be passing values into an array and comparing current values against recent values and if there is a drastic change then set the variable to last value before the change.  I also know modulus will factor in there somehow.  Being new to algorithmic thinking I can't quite figure out the logic. If someone knows of a piece of code out there that accomplishes this it'd be awesome.
Page Index Toggle Pages: 1