From d61bd67d798f1043bf67cf0d3b49f760ab1607e8 Mon Sep 17 00:00:00 2001 From: Ion Date: Sun, 5 Feb 2017 09:29:03 +0200 Subject: [PATCH 1/8] Add touch examples --- examples/01.Touch/touchIntrrerupt.ino | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 examples/01.Touch/touchIntrrerupt.ino diff --git a/examples/01.Touch/touchIntrrerupt.ino b/examples/01.Touch/touchIntrrerupt.ino new file mode 100644 index 00000000000..bccc303d7d9 --- /dev/null +++ b/examples/01.Touch/touchIntrrerupt.ino @@ -0,0 +1,35 @@ +/* +This is un example howto use Touch Intrrerupts +The bigger the threshold, the more sensible is the touch +*/ + +int threshold = 40; +bool touch1detected = false; +bool touch2detected = false; + +void gotTouch(){ + touch1detected = true; +} + +void gotTouch1(){ + touch2detected = true; +} + +void setup() { + Serial.begin(115200); + delay(1000); // give me time to bring up serial monitor + printf("\n ESP32 Touch Interrupt Test\n"); + touchAttachInterrupt(T2, gotTouch, threshold); + touchAttachInterrupt(T3, gotTouch1, threshold); +} + +void loop(){ + if(touch1detected){ + touch1detected = false; + Serial.println("Touch 1 detected"); + } + if(touch2detected){ + touch2detected = false; + Serial.println("Touch 2 detected"); + } +} From ad788e230d85733f8545235b5e7131ad87b50f7c Mon Sep 17 00:00:00 2001 From: Ion Date: Sun, 5 Feb 2017 14:15:04 +0200 Subject: [PATCH 2/8] Rename examples/01.Touch/touchIntrrerupt.ino to examples/01.Touch/touchIntrerrupt/touchIntrrerupt.ino --- examples/01.Touch/{ => touchIntrerrupt}/touchIntrrerupt.ino | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/01.Touch/{ => touchIntrerrupt}/touchIntrrerupt.ino (100%) diff --git a/examples/01.Touch/touchIntrrerupt.ino b/examples/01.Touch/touchIntrerrupt/touchIntrrerupt.ino similarity index 100% rename from examples/01.Touch/touchIntrrerupt.ino rename to examples/01.Touch/touchIntrerrupt/touchIntrrerupt.ino From 5dffe49a3cf553342912b09a1bce13f098718ee3 Mon Sep 17 00:00:00 2001 From: Ion Date: Sun, 5 Feb 2017 14:33:25 +0200 Subject: [PATCH 3/8] Rename examples/01.Touch/touchIntrerrupt/touchIntrrerupt.ino to libraries/Touch/examples/touchIntrrerupt/touchIntrrerupt.ino --- .../Touch/examples/touchIntrrerupt}/touchIntrrerupt.ino | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {examples/01.Touch/touchIntrerrupt => libraries/Touch/examples/touchIntrrerupt}/touchIntrrerupt.ino (100%) diff --git a/examples/01.Touch/touchIntrerrupt/touchIntrrerupt.ino b/libraries/Touch/examples/touchIntrrerupt/touchIntrrerupt.ino similarity index 100% rename from examples/01.Touch/touchIntrerrupt/touchIntrrerupt.ino rename to libraries/Touch/examples/touchIntrrerupt/touchIntrrerupt.ino From c14d3b4740f9db765b6e3ccbb4a2d77ba441671d Mon Sep 17 00:00:00 2001 From: Ion Date: Sun, 5 Feb 2017 14:36:28 +0200 Subject: [PATCH 4/8] Rename libraries/Touch/examples/touchIntrrerupt/touchIntrrerupt.ino to libraries/ESP32/examples/Touch/touchIntrerrupt/touchIntrrerupt.ino --- .../examples/Touch/touchIntrerrupt}/touchIntrrerupt.ino | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename libraries/{Touch/examples/touchIntrrerupt => ESP32/examples/Touch/touchIntrerrupt}/touchIntrrerupt.ino (100%) diff --git a/libraries/Touch/examples/touchIntrrerupt/touchIntrrerupt.ino b/libraries/ESP32/examples/Touch/touchIntrerrupt/touchIntrrerupt.ino similarity index 100% rename from libraries/Touch/examples/touchIntrrerupt/touchIntrrerupt.ino rename to libraries/ESP32/examples/Touch/touchIntrerrupt/touchIntrrerupt.ino From 635f8060329a3d1e0fe7055ab764d4557614773c Mon Sep 17 00:00:00 2001 From: Ion Date: Sun, 5 Feb 2017 15:14:12 +0200 Subject: [PATCH 5/8] Update touchIntrrerupt.ino --- .../ESP32/examples/Touch/touchIntrerrupt/touchIntrrerupt.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ESP32/examples/Touch/touchIntrerrupt/touchIntrrerupt.ino b/libraries/ESP32/examples/Touch/touchIntrerrupt/touchIntrrerupt.ino index bccc303d7d9..96bb357bcb7 100644 --- a/libraries/ESP32/examples/Touch/touchIntrerrupt/touchIntrrerupt.ino +++ b/libraries/ESP32/examples/Touch/touchIntrerrupt/touchIntrrerupt.ino @@ -18,7 +18,7 @@ void gotTouch1(){ void setup() { Serial.begin(115200); delay(1000); // give me time to bring up serial monitor - printf("\n ESP32 Touch Interrupt Test\n"); + Serial.println("ESP32 Touch Interrupt Test"); touchAttachInterrupt(T2, gotTouch, threshold); touchAttachInterrupt(T3, gotTouch1, threshold); } From 4a3f3b4c59949dda8f08fb0483ec35ad1ce8628f Mon Sep 17 00:00:00 2001 From: Ion Date: Sun, 5 Feb 2017 15:17:45 +0200 Subject: [PATCH 6/8] Rename libraries/ESP32/examples/Touch/touchIntrerrupt/touchIntrrerupt.ino to libraries/ESP32/examples/Touch/TouchIntrerrupt/TouchIntrrerupt.ino --- .../touchIntrrerupt.ino => TouchIntrerrupt/TouchIntrrerupt.ino} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename libraries/ESP32/examples/Touch/{touchIntrerrupt/touchIntrrerupt.ino => TouchIntrerrupt/TouchIntrrerupt.ino} (100%) diff --git a/libraries/ESP32/examples/Touch/touchIntrerrupt/touchIntrrerupt.ino b/libraries/ESP32/examples/Touch/TouchIntrerrupt/TouchIntrrerupt.ino similarity index 100% rename from libraries/ESP32/examples/Touch/touchIntrerrupt/touchIntrrerupt.ino rename to libraries/ESP32/examples/Touch/TouchIntrerrupt/TouchIntrrerupt.ino From 0a1277bb621523f545a6043a8dcb4f70fe392c4c Mon Sep 17 00:00:00 2001 From: Ion Date: Sun, 5 Feb 2017 17:50:36 +0200 Subject: [PATCH 7/8] Rename libraries/ESP32/examples/Touch/TouchIntrerrupt/TouchIntrrerupt.ino to libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino --- .../TouchIntrrerupt.ino => TouchInterrupt/TouchInterrupt.ino} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename libraries/ESP32/examples/Touch/{TouchIntrerrupt/TouchIntrrerupt.ino => TouchInterrupt/TouchInterrupt.ino} (100%) diff --git a/libraries/ESP32/examples/Touch/TouchIntrerrupt/TouchIntrrerupt.ino b/libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino similarity index 100% rename from libraries/ESP32/examples/Touch/TouchIntrerrupt/TouchIntrrerupt.ino rename to libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino From cb4dd9b95ea07c5cc24380d833fcb0893bf8362b Mon Sep 17 00:00:00 2001 From: Ion Date: Sun, 5 Feb 2017 17:52:20 +0200 Subject: [PATCH 8/8] Update TouchInterrupt.ino --- .../examples/Touch/TouchInterrupt/TouchInterrupt.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino b/libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino index 96bb357bcb7..8f40382ca56 100644 --- a/libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino +++ b/libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino @@ -7,11 +7,11 @@ int threshold = 40; bool touch1detected = false; bool touch2detected = false; -void gotTouch(){ +void gotTouch1(){ touch1detected = true; } -void gotTouch1(){ +void gotTouch2(){ touch2detected = true; } @@ -19,8 +19,8 @@ void setup() { Serial.begin(115200); delay(1000); // give me time to bring up serial monitor Serial.println("ESP32 Touch Interrupt Test"); - touchAttachInterrupt(T2, gotTouch, threshold); - touchAttachInterrupt(T3, gotTouch1, threshold); + touchAttachInterrupt(T2, gotTouch1, threshold); + touchAttachInterrupt(T3, gotTouch2, threshold); } void loop(){