UFO Touch example

Open Touch example on Arduino IDE

Source code

 // inslude the TOUCH library:
 #include <touch.h>
 
 
 TOUCH touch;
 void setup() {
   touch.begin();
   Serial.begin(9600);
 }
 
 void loop() {
   touch.scan();
 	
   if (touch.getstatus(TOUCH_KEY1) == TOUCH_PRESSED) {
     Serial.println("Touch KEY1 Pressed !");
   }
   if (touch.getstatus(TOUCH_KEY2) == TOUCH_PRESSED) {
     Serial.println("Touch KEY2 Pressed !");
   }
   if (touch.getstatus(TOUCH_KEY3) == TOUCH_PRESSED) {
     Serial.println("Touch KEY3 Pressed !");
   }
   delay(100);
 } 

Download and run the Touch example

Click on the "upload" button,Compile and upload Touch example. After the upload is complete, Click touch button on UF0 board, Serial port displays information as show below :
Copyright (c) 2008-2016 Seeed Development Limited (www.seeedstudio.com / www.seeed.cc)
This static html page was created from http://www.seeedstudio.com/wiki