Yeongsoo Kim / Mbed 2 deprecated Mecha_Hall_Sensor

Dependencies:   mbed

Sensor/HallSensor.h

Committer:
yeongsookim
Date:
2020-10-31
Revision:
1:d43df9a7cef2
Parent:
0:3ead6014ad51

File content as of revision 1:d43df9a7cef2:

#ifndef MBED_HallSensor_H
#define MBED_HallSensor_H

#include "mbed.h"

#define PI 3.141592


class HallSensor
{
public:
    HallSensor(PinName a);
    
    int getPinState ();
    float getSpeed_rps();

protected:
    void risingCallback();

    InterruptIn m_hallSensor;
    Timer m_timer_sec;
    float m_period_sec;
};

#endif