Skip to content

Use touchRead() function on ESP32-H2 #11478

Closed
@Mqxx

Description

@Mqxx

Board

ESP32-H2 Super Mini

Device Description

ESP32-H2 Super Mini on a breadboard

Hardware Configuration

Nothing

Version

latest stable Release (if not listed below)

IDE Name

Arduino IDE

Operating System

Windows 10

Flash frequency

64MHz

PSRAM enabled

no

Upload speed

921600

Description

Unable to use the touch example sketch. I can not find any reference if I can even use the touchRead() function on the ESP32-H2. If not is there an alternative that I can use?

Sketch

#include "Arduino.h"

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

void loop() {
  Serial.printf("T2 pin2 = %d \n", touchRead(2));
  delay(100);
}

Debug Message

C:\Users\Mqx\AppData\Local\Temp\.arduinoIDE-unsaved2025517-10792-1r8b5qd.0rat\sketch_jun17a\sketch_jun17a.ino: In function 'void loop()':
C:\Users\Mqx\AppData\Local\Temp\.arduinoIDE-unsaved2025517-10792-1r8b5qd.0rat\sketch_jun17a\sketch_jun17a.ino:18:36: error: 'touchRead' was not declared in this scope; did you mean 'touch_pad_t'?
   18 |   Serial.printf("T2 pin2 = %d \n", touchRead(2));
      |                                    ^~~~~~~~~
      |                                    touch_pad_t
exit status 1

Compilation error: 'touchRead' was not declared in this scope; did you mean 'touch_pad_t'?

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions