/** 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 */
/ 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
- /
main.cpp
- Committer:
- icserny
- Date:
- 2015-10-31
- Revision:
- 0:64ba2b612c25
- Child:
- 1:5ec182dbf86d
File content as of revision 0:64ba2b612c25:
#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); } }