Antonia Baumgartner / Mbed 2 deprecated YB_copy

Dependencies:   mbed

Fork of Versuch21 by Antonia Baumgartner

Revision:
0:b886f13e4ac6
Child:
1:6ef5bc60e69c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Classes/IRSensorGF.cpp	Sun Apr 22 16:14:54 2018 +0000
@@ -0,0 +1,26 @@
+#include <cmath>
+#include "IRSensorGF.h"
+
+using namespace std;
+
+    IRSensorGF::IRSensorGF(AnalogIn& distance):
+    
+        distance(distance) {
+            
+    
+    }
+
+    IRSensorGF::~IRSensorGF() {}
+    
+    int IRSensorGF::read() {
+        int d;
+
+     if (3300*(distance)>2900){//5-6cm
+        d=1;
+        }
+     else{
+        d=0;
+        }
+    return d;
+    
+    }
\ No newline at end of file