Created
December 10, 2016 16:12
-
-
Save prasertsakd/77b37f12f587d88ddf522fb34ecd0276 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int ledPin = 2; // the number of the LED pin | |
const int threshold = 40; // the number of the LED pin | |
int ledState = LOW; // ledState used to set the LED | |
void setup() { | |
// put your setup code here, to run once: | |
//pinMode(ledPin, OUTPUT); | |
Serial.begin(115200); | |
touchAttachInterrupt(T0 , click , threshold ); | |
} | |
void loop() { | |
Serial.println( touchRead(T0) ); | |
delay(200); | |
} | |
void click () { | |
Serial.println("click!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment