Hey! I want to configure mpu6050 to send an interrupt to esp32 when any motion is detected. I have connected the sensor via the following way.
MPU.SCL -> G22
MPU.SDA -> G21
VCC -> 3v3
GND -> GND
MPU.INT -> G15
I want to use the INT pin to trigger the esp32 to wake from deep sleep. I tried some code such as one from here and another from one github repo which is doing exactly what i want to achieve here But in both of these code It only gives readings for one time and after that there is no output even after rigorous shaking of the sensor.
My basic task is to wake esp32 from deep sleep once the readings exceed the threshold. I have seen the threshold can be set using setMotionDetectionThreshold (uint8_t thr) in Adafruit_MPU6050 Library
But the motion detection example in the adafruit library doesnt use INT pin. I specifically need the INT pin to wake esp from deep sleep.
I havent worked with interrupts earlier and this is my first time learning interrupt programming.
Can anyone help me how can I wake the esp32 via INT pin of mpu6050
Thank You