Skip to content

touchAttachInterrupt callback not called #5799

@Johboh

Description

@Johboh

Hardware:

Board: ESP32-S2FN4R2 / S2 Mini
Core Installation version: 2.0.0
IDE name: Arduino 1.8.16
Flash Frequency: 80Mhz
PSRAM enabled: yes
Upload Speed: 921600
Computer OS: Windows 10

Description:

No interrupt callback on touch, but reading touch works as expected.

Sketch

uint16_t threshold = 1500;
bool touchdetected = false;

void gotTouch(){
 touchdetected = true;
}

void setup() {
  Serial.begin(115200);
  delay(1000); // give me time to bring up serial monitor
  Serial.println("ESP32 Touch Interrupt Test");
  touchAttachInterrupt(T5, gotTouch, threshold);
}

void loop(){
  if(touchdetected){
    touchdetected = false;
    Serial.println("Touch detected"); // Never printed
  }
  Serial.println(touchRead(T5));
  delay(200);
}

Serial output

Output when not touching:

1767
1782
1808
1797
1795
1823
1790
1817
1816
1843
1808
1844
1844

output when touching:

949
215
2100
1458
558
1698
2033
97
1098
1715
639
1397
2079
320
762
1883
1003
125
2082
1586
414

Debug Messages:

Sorry, even when enabling Core Debug Level: Debug, nothing additional is written to serial port.

Activity

added this to the 2.1.0 milestone on Oct 24, 2021
self-assigned this
on Jan 19, 2022
modified the milestones: 2.1.0, 2.0.3 on Jan 31, 2022
Repository owner moved this from In Progress to Done in Arduino ESP32 Core Project Roadmapon Feb 3, 2022
added a commit that references this issue on Feb 3, 2022
0ea485e
added a commit that references this issue on Feb 4, 2022
2be27a3
added
Status: SolvedThe issue has been resolved and requires no further action.
and removed on Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Status: SolvedThe issue has been resolved and requires no further action.

Type

No type

Projects

Status

Done

Relationships

None yet

    Development

    Participants

    @Johboh@SuGlider@VojtechBartoska

    Issue actions

      touchAttachInterrupt callback not called · Issue #5799 · espressif/arduino-esp32