/** 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

Fork of 04_TSISensor by Istvan Cserny

Committer:
icserny
Date:
Sat Oct 31 17:22:17 2015 +0000
Revision:
0:64ba2b612c25
Child:
1:5ec182dbf86d
Temporary publication

Who changed what in which revision?

UserRevisionLine numberNew contents of line
icserny 0:64ba2b612c25 1 #include "mbed.h"
icserny 0:64ba2b612c25 2 #include "TSISensor.h"
icserny 0:64ba2b612c25 3
icserny 0:64ba2b612c25 4 int main(void) {
icserny 0:64ba2b612c25 5 PwmOut led(LED_BLUE);
icserny 0:64ba2b612c25 6 TSISensor tsi;
icserny 0:64ba2b612c25 7
icserny 0:64ba2b612c25 8 while (true) {
icserny 0:64ba2b612c25 9 float s = tsi.readPercentage();
icserny 0:64ba2b612c25 10 led = 1.0 - s*s;
icserny 0:64ba2b612c25 11 wait(0.1);
icserny 0:64ba2b612c25 12 }
icserny 0:64ba2b612c25 13 }