Program using Touch Sensor and PWM function. This code set a value of brightness in RGB led using Touch Sensor like a slider. The begining of touch is used to select a color. The end of touch is used to select an effect.

Dependencies:   MMA8451Q TSI mbed

Fork of FRDM_TSI by Subhrajit Mitra

main.cpp

Committer:
chris
Date:
2012-10-12
Revision:
1:51b1b688179a
Parent:
0:0f00f07ebde0
Child:
5:7f7b888f616b

File content as of revision 1:51b1b688179a:

#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);
    }
}