Skip to content

Interrupt use wrong pin on Arduino Nano ESP32 #10209

Closed
@andreock

Description

@andreock

Board

Arduino Nano ESP32

Device Description

Arduino Nano ESP32

Hardware Configuration

Pin D5 is set in INPUT_PULLUP mode and connected to a push button to GND.

Version

v3.0.4

IDE Name

PlatformIO

Operating System

Arch Linux

Flash frequency

80Mhz

PSRAM enabled

no

Upload speed

460800

Description

When i use the function attachInterrupt(digitalPinToGPIONumber(D5), change_state, CHANGE); the pin that handle interrupt is the D8 pin despite I use digitalPinToGPIONumber(D5). On the same board interrupt worked until about begin of August then stopped to work, I also rollback to 2.0.16 version of arduino-esp32 but still no works. Can be a problem of the board?

EDIT: 2.0.14 works

Sketch

#include <Arduino.h>

bool test = false;

void ARDUINO_ISR_ATTR change_state() {
  test = true;
}

void setup() {
  Serial.begin(9600);
  pinMode(D5, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(D5), change_state, CHANGE);
}

void loop() {
  if(test)
    Serial.println("Hello");
  Serial.println("World");
  delay(1000);
}

Debug Message

No guru meditation error happened

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions