-
Notifications
You must be signed in to change notification settings - Fork 7.7k
-
Hi guys,
the touch interrupt event never occurs in my code. I am using VS code with PlatformIO and Arduino framework.
Below is my code snippet:
#define STATE_GPIO_TOUCH_BUT1 4 // PIN definition for button 1
int threshold_diff = 1000;
touchAttachInterrupt(STATE_GPIO_TOUCH_BUT1, gotTouchBut1, touchRead(STATE_GPIO_TOUCH_BUT1)+threshold_diff);
void gotTouchBut1(){
Serial.print("Button1 ");
Serial.println(millis());
}
The thresholds are 45,000 for the untouched state and 55,000 for the touched state. Yet the gotTouchBut1() function is never called. Did I miss something?
If I use the same code on an ESP32-S2, it works without problems and enters the interrupt area as desired.
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment