/** TSISensor example program * Read the capacitive touch slider of the FRDM-KL25Z board * and control the power of the blue LED accordingly. * * Hardware requirements: * - Freescale FRDM-KL25Z board */

Dependencies:   TSI mbed

/ TSISensor example program

  • Read the capacitive touch slider of the FRDM-KL25Z board
  • and control the power of the blue LED accordingly.
  • Hardware requirements:
  • - Freescale FRDM-KL25Z board
  • /
Revision:
0:64ba2b612c25
Child:
1:5ec182dbf86d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Oct 31 17:22:17 2015 +0000
@@ -0,0 +1,13 @@
+#include "mbed.h"
+#include "TSISensor.h"
+ 
+int main(void) {
+    PwmOut led(LED_BLUE);
+    TSISensor tsi;
+    
+    while (true) {
+        float s = tsi.readPercentage();
+        led = 1.0 - s*s;
+        wait(0.1);
+    }
+}
\ No newline at end of file