joshnishikawa / MIDIcontroller

A library for creating Teensy MIDI controllers with support for hold or latch buttons, potentiometers, encoders, capacitive sensors, Piezo transducers and other velocity sensitive inputs with aftertouch.
223 stars 19 forks source link

start value of RotaryEncoder #24

Closed mrbbp closed 1 year ago

mrbbp commented 1 year ago

Hello,

thanks for this fabulous lib that simplifying greatly dev on midi custom device (i'm not a great fan of C and arduino IDE but teensy is great for midi device playground)

This not realy an issue, i suppose there is a simple solution. The encoder value start at 0; and conterclockwise turns do not send update value until there is enough turn clockwise. is there a way to offset the start value to 64, to be able to detect counterclockwise turn at start?

regards

mrbbp commented 1 year ago

I found !

myEnc.write(64);

or for multiple encoder

for (int i = 0; i< ENCODEURS_NBR;i++) {
  Encodeurs[i] = new MIDIenc(encPinA[i], encPinB[i], analogPinsCC[i]);
  Encodeurs[i]->write(64);
  Boutons[i] = new MIDIbutton(buttonPin[i],buttonPinsCC[i], LATCH);
}

regards