Skip to content

Instantly share code, notes, and snippets.

@prasertsakd
Created December 10, 2016 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prasertsakd/77b37f12f587d88ddf522fb34ecd0276 to your computer and use it in GitHub Desktop.
Save prasertsakd/77b37f12f587d88ddf522fb34ecd0276 to your computer and use it in GitHub Desktop.
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