2nd year embedded systems project

Dependencies:   mbed C12832

Revision:
1:9d7c34bfe43e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Door_1_Docs/hcsr04.h	Tue Dec 15 18:15:48 2020 +0000
@@ -0,0 +1,20 @@
+#ifndef hcsr04_H
+#define hcsr04_H
+#include "mbed.h"
+ 
+ 
+ 
+class HCSR04 {
+  public:
+    HCSR04(PinName t, PinName e);
+    float echo_duration();
+    float distance();
+ 
+    private:
+        DigitalOut trig;
+        DigitalIn echo;
+        Timer timer;
+        float duration,distance_cm;
+};
+ 
+#endif
\ No newline at end of file