There was a small bug in the spelling of your library's method. I hope you accept this request. Sorry for the inconveniences and thanks for your library -- I'm just starting to use this platform. Greetings.

Dependencies:   TSI

Fork of TouchButton by Viraj Jayaweera

TouchButton.cpp

Committer:
taghoter
Date:
2015-03-23
Revision:
1:5eb472334273
Parent:
0:2afd6e977c5b

File content as of revision 1:5eb472334273:

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

TSISensor tsi;

int TouchButton::PressedButton(void)
{
 
    if(tsi.readPercentage()<0.01)
        return 0;
    else if(tsi.readPercentage()>0.75)  
        return 4;
    else if(tsi.readPercentage()>0.5)  
        return 3;
    else if(tsi.readPercentage()>0.25)  
        return 2;   
    else   
        return 1;
  
}