Skip to content

Instantly share code, notes, and snippets.

@ypelletier
Last active September 29, 2019 10:13
Exploration des broches tactiles de l'ESP32. Dans cette version, on affiche dans le moniteur série la valeur brute retournée par touchRead().
/*************************************************
* Exploration des broches tactiles de l'ESP32
* 3 broches sont activées: GPIO13, GPIO12, GPIO14
* Dans cette version, on affiche dans le moniteur
* série la valeur brute retournée par touchRead()
Plus d'infos:
https://electroniqueamateur.blogspot.com/2019/07/esp-32-utilisation-des-broches-tactiles.html
*************************************************/
const int boutonA = 13; // GPIO13 = T4
const int boutonB = 12; // GPIO12 = T5
const int boutonC = 14; // GPIO14 = T6
void setup()
{
Serial.begin(9600);
delay(1000);
}
void loop()
{
Serial.print("Bouton A: ");
Serial.println(touchRead(boutonA));
Serial.print("Bouton B: ");
Serial.println(touchRead(boutonB));
Serial.print("Bouton C: ");
Serial.println(touchRead(boutonC));
Serial.println("");
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment