This program is a PWM which varies the dutty cycle by the touchpad of FRDM KL25Z. We can observe the result with the variation of RGBled intensity

Dependencies:   TSI mbed

main.cpp

Committer:
lcorralesc1
Date:
2013-12-15
Revision:
0:c583c613f378

File content as of revision 0:c583c613f378:

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

int main(void) {
    PwmOut led(LED_GREEN);  
    PwmOut Salida(PTD4);
    TSISensor tsi;
    
    while (true) {
     if (tsi.readPercentage()!=0) // Asignacion de Luminosidad del led
     {
        led = 1.0 - tsi.readPercentage(); // Coordenadas del la asignacion del led 
        Salida=1.0 - tsi.readPercentage();
        wait(0.1); // Tiempo de es espera para retomar el ciclo
        
     }
    }
}