ss

Dependencies:   WS2812 PixelArray Adafruit_GFX

Committer:
eunsong
Date:
Sat Jun 15 13:48:45 2019 +0000
Revision:
3:700a0cf6beea
Parent:
0:27e31cadeb36
a

Who changed what in which revision?

UserRevisionLine numberNew contents of line
eunsong 0:27e31cadeb36 1 #ifndef hcsr04_H
eunsong 0:27e31cadeb36 2 #define hcsr04_H
eunsong 0:27e31cadeb36 3 #include "mbed.h"
eunsong 0:27e31cadeb36 4
eunsong 0:27e31cadeb36 5
eunsong 0:27e31cadeb36 6
eunsong 0:27e31cadeb36 7 class HCSR04 {
eunsong 0:27e31cadeb36 8 public:
eunsong 0:27e31cadeb36 9 HCSR04(PinName t, PinName e, RawSerial pc, int flag, int limit);
eunsong 0:27e31cadeb36 10 long echo_duration();
eunsong 0:27e31cadeb36 11 void distance();
eunsong 0:27e31cadeb36 12 void Trig();
eunsong 0:27e31cadeb36 13 long returndistance();
eunsong 0:27e31cadeb36 14
eunsong 0:27e31cadeb36 15 /*void setMode(bool mode);
eunsong 0:27e31cadeb36 16 int getStatus();
eunsong 0:27e31cadeb36 17 void clearStatus();*/
eunsong 0:27e31cadeb36 18 int flag;
eunsong 0:27e31cadeb36 19
eunsong 0:27e31cadeb36 20 private:
eunsong 0:27e31cadeb36 21 /*bool _repeat;
eunsong 0:27e31cadeb36 22 float _interval;
eunsong 0:27e31cadeb36 23 int _done;*/
eunsong 0:27e31cadeb36 24 DigitalOut trig;
eunsong 0:27e31cadeb36 25 DigitalIn echo;
eunsong 0:27e31cadeb36 26 RawSerial _pc;
eunsong 0:27e31cadeb36 27 Timer timer;
eunsong 0:27e31cadeb36 28 long duration;
eunsong 0:27e31cadeb36 29 int distance_cm;
eunsong 0:27e31cadeb36 30 int _limit;
eunsong 0:27e31cadeb36 31 };
eunsong 0:27e31cadeb36 32
eunsong 0:27e31cadeb36 33 #endif