Yeongsoo Kim / Mbed 2 deprecated Mecha_Distance_Sensor

Dependencies:   mbed

Revision:
2:45082fedef80
Parent:
1:a9251be32d0a
Child:
3:511df198e214
--- a/Sensor/DistanceSensor.cpp	Wed Nov 11 23:35:00 2020 +0000
+++ b/Sensor/DistanceSensor.cpp	Thu Nov 12 01:22:53 2020 +0000
@@ -9,10 +9,12 @@
 
 float DistanceSensor::getDistance_cm()
 {
-    if (m_analog >= 3.0){
+    float distance = 0.0;
+    
+    if (m_analogIn >= 3.0){
         distance = 5.0;
     }
-    else if (m_analog < 3.0 && m_analog >= 2.5){
+    else if (m_analogIn < 3.0 && m_analogIn >= 2.5){
         distance = 10.0;
     }
     else if (/* Fill in the blank */){