Skip to content

touchRead #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DiegoMendoza1 opened this issue Jan 11, 2017 · 8 comments
Closed

touchRead #122

DiegoMendoza1 opened this issue Jan 11, 2017 · 8 comments

Comments

@DiegoMendoza1
Copy link

Hi, I am looking for information about the capacitive touch and as they are programmed in the ide of arduino, I have seen that it is necessary to read them with the function touchRead but I do not find which is the librery that needs to recognize this function.

can anybody help me?

Thank you

@me-no-dev
Copy link
Member

no library is needed ;) just call touchRead(pin); on any pin that supports touch.

@DiegoMendoza1
Copy link
Author

I have done so, but when I build with the arduino ide it says touchRead is not declared

@me-no-dev
Copy link
Member

You must have selected the wrong board or something. touchRead is defined here;

@DiegoMendoza1
Copy link
Author

The board is correct, I have the esp devkit. I have written this code as an example and still does not recognize that touchRead is declared:

`#include <arduino.h>

int Touch = 20;

void setup() {

Serial.begin(115200);

pinMode(Touch, INPUT);

}

void loop() {

touchRead(Touch);

if(Touch == LOW){

Serial.println("ENABLE");

delay(1000);

else{
Serial.println ("DISABLE");

delay(1000);
}

}
}`

@me-no-dev
Copy link
Member

this sketch compiled just fine here. Also "Arduino" is capitalized. Also touchRead will return unsigned integer value, not LOW/HIGH.

@me-no-dev
Copy link
Member

btw are you sure you are running the latest esp32-arduino?

@DiegoMendoza1
Copy link
Author

I´m not sure, where is it?

@DiegoMendoza1
Copy link
Author

I found it, I didn´t have the latest version, now it compiles correctly.

Thanks

brentru added a commit to adafruit/arduino-esp32 that referenced this issue Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants