TSI read values are now sent to the serial port. Red LED part of the RGB will light up with an intensity that depends on the TSI read value.

Dependencies:   TSI mbed

Fork of FRDM_TSI by mbed official

main.cpp

Committer:
lmsousa
Date:
2015-05-07
Revision:
6:288cb3530ef4
Parent:
1:51b1b688179a

File content as of revision 6:288cb3530ef4:

#include "mbed.h"
#include "TSISensor.h"
Serial pc(USBTX, USBRX);

int main(void)
{
    pc.baud(9600);
    PwmOut rled(LED_RED);
    TSISensor tsi;
    rled=1;

    while (true) 
    {
        float n=tsi.readPercentage();
        pc.printf("Percentage= %3.0f %% \r\n ",n*100);
        rled = 1.0 - n;
        wait(0.1);  
     }
}