Hello,
struggling since a while with following effect.
An encoder is connected to an 8574 Expander connected by I2C, the interrupt pin from the Expander is connected to Pin 2 from an ESP8266 board.
void setup() {
setupMenu();
Serial.begin(9600);
Wire.begin();
multiIoAddExpander ( multiIo, ioFrom8574(0x20, 2), 10); //Expander pins
ioDevicePinMode(multiIo, EXPANDER1+0, INPUT); //P0 Pin 100 ( P0 auf 8574) Switch
ioDevicePinMode(multiIo, EXPANDER1+1, INPUT_PULLUP); //P1 Pin 101 Encoder Pin A
ioDevicePinMode(multiIo, EXPANDER1+2, INPUT_PULLUP); //P2 Pin 102 Encoder Pin B
ioDevicePinMode(multiIo, EXPANDER1+3, INPUT); //P3 Pin 103 ( P3 auf 8574) Clickwheel Encoder
ioDevicePinMode(multiIo, EXPANDER1+7, OUTPUT); //P7 Pin 107 Test mit LED
switches.initialise(multiIo, true);
switches.addSwitchListener(EXPANDER1 +0, &keyListenerExpander);
switches.addSwitchListener(EXPANDER1 +3, &keyListenerExpander);
//setupRotaryEncoderWithInterrupt(encoderAPin, encoderBPin, onEncoderChange, HWACCEL_REGULAR);
}
Additional is defined:
#define EXPANDER1 100
MultiIoAbstractionRef multiIo = multiIoExpander(EXPANDER1);
IoAbstractionRef multiIoENC = ioFrom8754(0x20, 2); //2 for Interrupt Pin ESP8266
TcMenu i can only operate if i do not use setupRotaryEncoderWithInterrupt(encoderAPin, encoderBPin, onEncoderChange, HWACCEL_REGULAR);
Using that setup of the Encoder does have as consequence the Encoder does not react in TcMenu.
The click wheel button does react.
Strange: This effect has exception: Test Codes do run using setupRotaryEncoderWithInterrupt, others not - without a visible change comparing the codes.
IoAbstractionRef multiIoENC = ioFrom8754(0x20, 2); i need for TcMenu, without there's no reaction in the Menu, with it does run like a charm.
Being confused a bit as i cannot get an idea how the pins are defined then.
The other strange thing is:
I can leave TcMenu by takeOverDisplay, work with the encoder in a text based human interface i need to see numbers better ( Bigger
) and to work with
hotkeys by click wheel click, doubleclick, tripleclick.
Encoder does work.
Giving back the display to TcMenu using giveBackDisplay has as effect that the encoder does not work in TcMenu anymore. I can see in the serial monitor that
the Encoder is in operation.
It looks the multiIoAbstraction i cannot define in TcMenu, therefore is use IoAbstractionRef.
How to setup the Encoder in an multiIoAbstraction for TcMenu and another Renderer as e.g. using an standard 1366 library ( E.g. Adafruit ) ?
If somebody has an idea what i am doing wrong pls. advice
Frank