sorry about the delay in answering, but I have been really busy with my real life job.
The rotary encoder (ALPS STEC12E07) is connected to pins 2 and 3 of the M5Stack and GND.
I also have used pins 22 and 23 in the past, but those can crash the app as soon as you are using the TFT of the M5Stack (looked into the header files of M5Stack and found that pin 22 is connected to the TFT).
I am using the following code, which you can find in variations on the web:
/* Read Quadrature Encoder
Connect Encoder to Pins encoder0PinA, encoder0PinB, and +5V.
Sketch by max wolf / www.meso.net
v. 0.1 - very basic functions - mw 20061220
int encoder0PinA = 2;
int encoder0PinB = 3;
int encoderPos = 0;
int lastReportedPos = 0;
int aValue = LOW;
int bValue = LOW;
int aValueLast = LOW;
But if I can get delta time between it change from 0 to 1 and change back from 1 to 0 it will work. But UI FLOW don't have any block that can read processing time. So it impossible to read duty time with digital pin read only.
I have tested your code several time.
I'm afraid, I found problem.
Soft AP function was operated first time, But When I reset module, It's not possible to access any more. It's always reset when i access M5stack soft AP mode.
I found "Guru Meditation Error" through debugging port.
Please let me know how to fix.
I'm now using WINDOW 10
Guru Meditation Error: Core 0 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x00000000 PS : 0x00060e30 A0 : 0x800f5e71 A1 : 0x3ffb3d70
A2 : 0x3ffc8a34 A3 : 0x3ffc8c88 A4 : 0x3ffafe8c A5 : 0x3ffc8c68
A6 : 0x0204a8c0 A7 : 0x6504a8c0 A8 : 0x800f5d14 A9 : 0x3ffb3d30
A10 : 0x3ffc8a44 A11 : 0x3ffc8c88 A12 : 0x3ffb3d7c A13 : 0x00000044
A14 : 0x00000001 A15 : 0x00000006 SAR : 0x00000010 EXCCAUSE: 0x00000014
EXCVADDR: 0x00000000 LBEG : 0x4000c349 LEND : 0x4000c36b LCOUNT : 0x00000000