Divide the slider into four areas

Dependents:   JeSuisUnGrandHomme

Fork of info1 by Guillaume Alli

info1.cpp

Committer:
Agachon
Date:
2015-01-13
Revision:
1:6bd5a7965b66
Parent:
0:432cc3112901
Child:
2:68deb4a53d73

File content as of revision 1:6bd5a7965b66:

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


TSISensor tsi2;

void appui_num(int *bp)
{
    if (tsi2.readPercentage()>0)
        *bp=1;
    else
        *bp=0;
}

void appui_ana (int *bp1,int *bp2,float seuil)
{
    if (tsi2.readPercentage()>0 && tsi2.readPercentage()<seuil)
    {
        *bp1=1;
        *bp2=0;
    }
    
    if (tsi2.readPercentage()>=seuil && tsi2.readPercentage()<=1)
    {
        *bp1=0;
        *bp2=1;
    }
}