Junhao Zhang / Mbed 2 deprecated DEBUG_10K

Dependencies:   mbed

Fork of DEBUG_10K by Xu ZHANG

Revision:
1:2967e2507d52
Parent:
0:1b13f03ce7eb
--- a/cal.cpp	Thu Mar 08 14:38:32 2018 +0000
+++ b/cal.cpp	Thu Mar 08 15:58:06 2018 +0000
@@ -61,14 +61,14 @@
     //pw id pulse width of level 0
     double angle=1;
     double temp=0;
-    if (pw>=320||pw<=480)
+    if (pw>320&&pw<=480)
     {   
         //angle=(pw-320)/320*180;
         temp=(double)pw;//+0.5
         angle=temp/16*9-180;
         return angle;
         }
-    else if (pw>=160||pw<=320)
+    else if (pw>=160&&pw<=320)
     {
         //angle=(320-pw)/320*180;
         temp=(double)pw;//+0.5