After a lot of testing I figured it out. The issue was not with the code the problem was the pin used.
In addition the code to configure a pin as an interrupt is working.
Seems like some features of this board operate differently from the other ESP32 boards.
For example some docs I found say that any pin can on an ESP32 board can be configured as an interrupt. But on the Heltec board not all pins actually work. Maybe there is extra coding or whatever.
I tested most of the pins on the Heltec board to see if they will operate as an interrupt pin and results are as follows
36, 37, 38, 39 - SEE NOTE
34 - NG
35 - NG
32 - OK
33 - OK
19 - OK
18 - OK
5 - OK
2 - OK
36, 37, 38, 39 exhibited strange behavior. They did work when configured as an interrupt but they activated in pairs.
For example if I configured Pin 37 as an interrupt Pin 36 also triggered an interrupt. Same condition for Pair 38 & 39.
The code snipets for the MPU6050 interrupt are as follows (dmpDataReady is interrupt routine)
#define INTERRUPT_PIN 39
void setup() {
pinMode(INTERRUPT_PIN, INPUT);
attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);
}
Feedback and suggestions are greatly appreciated
Now I need to work this code into my GPS Data Logger.
Question: The uBlox GPS Module uses two pins for data TX and RX. If the MPU6050 Accel/Gyro generates an interrupt will it cause issues with the sketch dropping GPS Data?