Example program to control the brightness of an LED using the touch sensor interface

Dependencies:   TSI mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "TSISensor.h"
00003 
00004 int main(void) {
00005     PwmOut led(LED_GREEN);
00006     TSISensor tsi;
00007     
00008     while (true) {
00009         led = 1.0 - tsi.readPercentage();
00010         wait(0.1);
00011     }
00012 }