Interface to a standard tarco sensor. Measure the periode and the cal the speed

Tarco.h

Committer:
gert_lauritsen
Date:
2013-11-07
Revision:
3:6d3f2034e5f1
Parent:
2:c50da089786a
Child:
4:35024179a736

File content as of revision 3:6d3f2034e5f1:

#include "mbed.h"

#ifndef _Tarco_H
#define _Tarco_H


class Tarco {

private:
    InterruptIn _tarcosensor;
    void click();
    uint32_t PrevPulses;
    int AdvPeriode;
    Timer t;
public:
    // ********************************************************************************
    // * Constructor
    // *
    // * @param flowsignal   The pin which is connected to the flowsensor.
    // ********************************************************************************
    Tarco(PinName tarcosignal);

    // ********************************************************************************
    // gives the tarco value in hz
    // ********************************************************************************

    float Speed();
    // ********************************************************************************
    // gives the tarco value in rotation pr min
    // ********************************************************************************

    float RPM();
};

#endif