Test

hcsr04.h

Committer:
fermedicius
Date:
2021-01-11
Revision:
0:2a1510763167

File content as of revision 0:2a1510763167:

#ifndef HCSR04_H
#define HCSR04_H
#include "mbed.h"


 
class HCSR04 {
  public:
    HCSR04(PinName t, PinName e);
    long echo_duration();
    long distance();
 
    protected:
        DigitalOut trig;
        DigitalIn echo;
        Timer timer;
        long duration,distance_cm;
};
 
#endif