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

Dependencies:   TSI mbed

Dependents:   FRDM-KL46Z_LCD_Test FRDM-KL46Z_LCD_Test FRDM-KL46Z_I2C-Scanner

Legacy Warning

This is an mbed 2 example. To learn more about mbed OS 5, visit the docs.

main.cpp

Committer:
mbed_official
Date:
2013-05-09
Revision:
5:b44f5f02b879
Parent:
1:51b1b688179a

File content as of revision 5:b44f5f02b879:

#include "mbed.h"
#include "TSISensor.h"

int main(void) {
    PwmOut led(LED_GREEN);
    TSISensor tsi;
    
    while (true) {
        led = 1.0 - tsi.readPercentage();
        wait(0.1);
    }
}