Hi, I have an incremental rotary encoder (E38S6G5-600B-G24N), its a 2 channel rotary encoder 5 cables ,
- Red - 5-24V
- Black - GND
- White - Channel A
- GREEN - Channel B
- Shielding - GND
My issue is that the rotary encoder doesn't call the interrupt on the Arduino GIGA R1, to be sure that the rotary encoder is not the issue itself I created this small test program and run it on both Arduino DUE and Arduino GIGA R1 (Both 3.3V devices) and I used the same connections Red on the 5V pin black on GND and channel A at pin 52. On the DUE there was no issue, but on the giga I cant get any results.
volatile int encoderCount = 0;
volatile int prevCount = 0;
void encoderISR()
{
encoderCount++;
}
void setup() {
Serial.begin(9600);
pinMode(52,INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(52),encoderISR,CHANGE);
}
void loop() {
if(encoderCount!=prevCount){
Serial.println(encoderCount);
prevCount=encoderCount;
}
}
Are the internal pullup resistor that much different on the GIGA and the DUE (could that be an issue?), are there any quick fix I could use, what could I do to make it work? Thanks.