Interrupt pins on QtPy ESP32-S2?

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
dwilliss
 
Posts: 24
Joined: Fri Oct 31, 2014 7:26 pm

Interrupt pins on QtPy ESP32-S2?

Post by dwilliss »

I have a QtPy ESP32-S2 and a VL53L4CX breakout
I'm trying to use the Interrupt from the VLC53L4CX to trigger some code.
I tied this to the A2 pin on the QtPy, but it never fires the interrupt.
My assumption is that the A0-A3 pins are Analog and just don't support interrupts.
Is there a pin that does?

I've used a logic probe and can see that the signal is actually getting to the pad.

Here's the Arduino code I've used..

Code: Select all

  // global stuff outside the setup()
  #define INTERRUPT_PIN A2 
  
  volatile int interruptCount = 0; 
  void measurementInterruptHandler()
  {
    ++interruptCount;
  }

  // This is in my setup()
  pinMode(INTERRUPT_PIN, INPUT_PULLUP);
  attachInterrupt(INTERRUPT_PIN, measurementInterruptHandler, FALLING);

In my loop code, I'm currently just printing out the interruptCount which is always 0.

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Interrupt pins on QtPy ESP32-S2?

Post by adafruit_support_mike »

The function attachInterrupt() probably can't recognize the symbol A2.

Try using the GPIO pin number instead of A12.

User avatar
dwilliss
 
Posts: 24
Joined: Fri Oct 31, 2014 7:26 pm

Re: Interrupt pins on QtPy ESP32-S2?

Post by dwilliss »

That didn't work. It turns out that A2 is just

Code: Select all

#define A2 9
. And the GPIO pin number is 9, so that didn't make any difference.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”