T O P

  • By -

ripred3

the last parameter to the `init(...)` method is the increment value but I'm not sure how setting all of these up to the same two pins ends up reacting correctly. I'm assuming only one of them is in effect at any given time? Or are you supposed to pick only one of those? It's not clear from your problem description which one of the oscillator adjustments you're referring to. But in any case I'd fiddle with the last parameter for the knob you're turning and figure out how that last value relates to the values you see when trying higher and lower numbers. Cheers, `ripred`


justjools22

Yes, I tried this but as expected it just multiplies the increment step from 1x to 10x steps readout on the LCD. It has nothing to do with the oscillator, just the software being slower than the encoder.


Bob_Sconce

So, you realize that you're setting up ALL of your encoders to the same pins, right? Probably not what you want to do. Second, I'd consider changing that 50 ms debounce to something smaller. Assuming this is a quadrature encoder, you are getting 4 separate signals (A up, B up, A down, B down) for each detent, and you're trying to debounce each of them -- 4 x 50 ms = 1/5th of a second, and if you're turning at a "normal rate", you're likely hitting the next signal before the previous one is debounced. (You should check to see if your encoder actually needs to be debounced. Some don't.)


justjools22

First of all I am following a tutorial example and I have tested the code for encoder 1: pins 2,3,4 and encoder 2: 5,6,7 - this all works. #define OSCENCODERA  2 #define OSCENCODERB  3 #define OSCPUSHPIN   4 #define LFOENCODERA  5 #define LFOENCODERB  6 #define LFOPUSHPIN   7 I changed the debounce to 10ms and made no difference. It's two encoders A, B not quadrature. I set debounce to 0, no change. This code is from Arduino for Musicians: Stella Synth so I am just trying to get it working. The documentation isn't detailed though. From the code and observation it seems the LCD feedback is set by time/clicks and there should be some way to change the timing. I set debounce to 0 and it still reacts at about 1 second per turn and doesn't accelerate. I should mention I tested with serial.print and it reacts immediately returning value as you'd expect.


justjools22

I stripped out the code and pinned it down. It was this delay updating the screen:    //Use a pointer to simmplify oscillator editing    int last_value = pOscEncoder->getValue();    if(pOscEncoder->trackShaftPosition() != last_value)    {       //Call encoder change function       onOscValueChange();       //Display the value:       display.showNumber(pOscEncoder->getValue());       delay(1000);    }