Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

incrementing a pot

When I increment a pot from a push button it works fine. If I connect the pot to the push button through a flipflop ( I want to increment the pot at half rate) the pot increments continuously to its max value when flipflop is true.
0 Kudos
Message 1 of 4
(3,536 Views)
The pot increment only appears to work with a pushbutton when it�s pushed and released quickly. But hold the pushbutton down and the pot increments out of control to its maximum value. This is because the increment occurs WHILE the signal is true. You can change any continuous true signal to a momentary several different ways. One is to create a new oneshot object with a very short timer delay such as 00:00.1 to use as the logical connection. You could also embed a oneshot timer in the logical connection such as oneshot (FlipFlop1, 00:00.1). Counter objects are also useful as they count occurrences of true signals; durations of the true signal are not a factor. Hint: the reset of a counter can be based on its own value. There are many other ways to get your de
sired result. Sometimes its fun just to see how many different ways the same thing can be done with Lookout.
0 Kudos
Message 2 of 4
(3,536 Views)
You are right, it is fun to find different ways to do the same things. Here's my take on it. The first thing you must realize is that a pot will increment by one single count each time you depress your pushbutton (unless you hold it down). The single count is solely dependent on the resolution of your pot. If your resolution is 10, your pot will your inc or dec by 10 each time you hit your button. Now, I think your question was how to inc or dec by full or half count. You cannot do this with a single pot, the resolution is a constant numeric value, not dynamic. However, we can find ways to work around pretty much anything on this board. What I have done is use 2 pots, pot1 has a resolution of 1 and pot2 has a resolution of 2. This will simulate your full and half coun
ts. Now to tie them together, we will need a switch to determine which pot we will use, 2 pushbuttons (1 for inc and 1 for dec) and an expression object. Exp1 will be this "if(Sw1,Pot1,Pot2)". Now for the connections. Edit connections as follows: Pot1, increment >> Sw1 and PB1, decrement >> Sw1 and PB2, value >> Exp1. Then Pot2, increment >> NOT Sw1 and PB1, decrement >> NOT Sw1 and PB2, value >> Exp1.

The only catch to this is that if you are using the 1/2 value pot and incrementing by 1, Pot2 can only react to every 2 adjustments, therefore if your pot is set at 13 and you flip your switch to change to the other pot, your value will go to 14 because of the higher resolution.

Hope this helps,
Carl
0 Kudos
Message 3 of 4
(3,536 Views)
Thanks Everyone
I had not noticed that the switch will continually increment when held down.
My book says the pot increment works on transitions I think you agree it does not. I had tried the timer approach, the pot incremented by more than one, even if it worked consistently on one machine not something to be trusted on another machine.
I need a pot because the user must be able to easily overide and set the value to a arbitary number, a counter can only reset to zero.
LOOKOUT seems full of little gotchas like this.
0 Kudos
Message 4 of 4
(3,536 Views)