Pedro Colla / Mbed 2 deprecated CTo_VyV_TPAlarma

Dependencies:   mbed

SensorAnalogico.cpp

Committer:
pcolla
Date:
2013-11-16
Revision:
0:f42f18c56a88

File content as of revision 0:f42f18c56a88:

#include "alarma.h"
#include "mbed.h"

float   lectura = 0;
float   referencia = 0;

int SensorAnalogico(void){
    lectura = Filtro();
    referencia = Ref;                       //Pot1
    if(lectura <= referencia)
        AStatus = 1;
    if(lectura > referencia)
        AStatus = 2;
    if((lectura >= 0)&&(lectura <0.1))
        AStatus = 0;
    return AStatus;
}